Author Archives: Robins

[Solved] YOLOv4 Error: Layer before convolutional layer must output image.: No error

 

Recently, when learning yolo4 and running your own data set with yolo4, I found that the
training set layer before revolutionary layer must output image.: no error.

 

1. Solution

Check the customized cfg file. The size of the input image is set as follows

if both height and width are set to a multiple of 32, this problem will not occur. I set it here as 416, 416

2. Follow up questions

Pay attention to setting size to the size of the picture in your dataset, otherwise, you may not be able to open the picture. The error is as follows

Can’t load image xxxxxxxxxxxxxxxxxx

[Solved] Android Could not determine artifacts for XXXX: Skipped due to earlier error

Recently, I encountered the following problems when using robolectric unit test:

It has been reported that the resource class cannot be found, so it needs to be added to gradle under the app (the code is manually typed, there may be an error, sorry)

testOptions{
	unitTests{
			includeAndroidResources = true
	}
}

After adding the above code, there is an error in the title, specifically android.test.monitor2… This can’t be found. Each time sync takes a long time, and then report the same error. Refer to the following link article, but it doesn’t help me much.

Ask colleagues for help. After comparing our configurations, we found that the gradle version references are different (gradle/wrapper/gradle wrapper. Properties). The previous references are:

distributionUrl:=https\://service.gradle.org/distributions/gradle-5.4.1-all.zip

Mine is taken directly from the company mapping Maven library. It is a local reference with a lower version:

distributionUrl:=../../../../tools/gradle-4.1-all.zip

I changed the gradle configuration according to her configuration and synced again. The problem was solved.

[Solved] MIT cheetah make error: ‘ioctl’ was not declared in this scope

Question:

error: ‘ioctl’ was not declared in this scope
   35 |   ioctl(fd, TCGETS2, &tty);

Solution:
Open Cheetah-Software-master/robot/src/rt/rt_serial.cpp
Change

#define termios asmtermios

#include <asm/termios.h>

#undef termios

#include <termios.h>
#include <math.h>
#include <pthread.h>
#include <stropts.h>
#include <endian.h>
#include <stdint.h>

to

#define termios asmtermios

//#include <asm/termios.h>
#include<asm/ioctls.h>
#include<asm/termbits.h>

#undef termios

#include<sys/ioctl.h>
#include <termios.h>
#include <math.h>
#include <pthread.h>
#include <stropts.h>
#include <endian.h>
#include <stdint.h>

[Solved] Method threw ‘java.lang.StackOverflowError‘ exception. Cannot evaluate

Cause of problem

This error occurs when traversing the binary tree hierarchy. At first, it is thought that the stack overflow is caused by circular reference
later, it was found that the causes of the problem are as follows:
because the attribute references the child attribute, the toString method will constantly call the attribute of the child node. Finally, the stack overflowed.

Solution

Rewrite the toString method. Be careful not to print the properties of the calling child nodes
finally, paste a section of tree level traversal implementation code.

package com.zouch.onetoten;

import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import org.springframework.util.CollectionUtils;

import java.util.*;

/**
 * @author Zouch
 * @date 2021/8/25 下午1:13
 * Hierarchical tree traversal (no restriction that it must be a binary tree)
 * Idea.
 * Use a queue, and the condition for the outgoing loop is that the queue element is empty.
 * judge each time a node is out of the queue, and when there is a node in the queue, add all its children to the queue
 * Then add the nodes to the list
 */

@Getter
@Setter
public class TreeOfBfs {

    private TreeNode rootNode;

    @Override
    public String toString() {
        return "TreeOfBfs{" +
                "rootNode=" + rootNode +
                '}';
    }

    @Data
    public static class TreeNode {
        private Object key;

        private TreeNode parent;

        private List<TreeNode> treeNodes;

        @Override
        public String toString() {
            return "TreeNode{" +
                    "key=" + key +
                    ", parent=" + parent;
        }
    }

    public static List<TreeNode> levelTraverse(TreeNode rootNode) {
        if (Objects.isNull(rootNode)) {
            return null;
        }
        Queue<TreeNode> queue = new LinkedList<>();
        queue.add(rootNode);
        List<TreeNode> list = new LinkedList<>();
        while (queue.size() > 0) {
            TreeNode poll = queue.poll();
            list.add(poll);
            List<TreeNode> treeNodes = poll.getTreeNodes();
            if (CollectionUtils.isEmpty(treeNodes)){
                continue;
            }
            queue.addAll(treeNodes);
        }
        return list;
    }

    public static void main(String[] args) {
        TreeOfBfs treeOfBfs = new TreeOfBfs();
        TreeNode rootNode = new TreeNode();
        treeOfBfs.setRootNode(rootNode);

        TreeNode node1 = new TreeNode();
        node1.setParent(rootNode);
        node1.setKey("Left 1");

        TreeNode node2 = new TreeNode();
        node2.setParent(rootNode);
        node2.setKey("Right 2");

        TreeNode node3 = new TreeNode();
        node3.setParent(node2);
        node3.setKey("Left 3");

        TreeNode node4 = new TreeNode();
        node4.setParent(node2);
        node4.setKey("Right4");

        List<TreeNode> treeNodes = new ArrayList<>();
        treeNodes.add(node1);
        treeNodes.add(node2);
        rootNode.setTreeNodes(treeNodes);

        List<TreeNode> treeNodes2 = new ArrayList<>();
        treeNodes2.add(node3);
        treeNodes2.add(node4);
        node2.setTreeNodes(treeNodes2);

        List<TreeNode> result = levelTraverse(rootNode);
        System.out.println(result.toString());

    }

}

[Solved] Error creating bean with name ‘configurationPropertiesBeans‘ defined in class path resource

Register your spring boot project with the Nacos service using spring cloud, and start the project after configuring the file

Springboot version

Spring cloud version

Startup class annotation

Start the class, and the result is an error

Solution:

Because the springboot version does not correspond to the Nacos version in springcloud, students who have studied springcloud should know that the springboot version and the Nacos version in springcloud must correspond, and the responsible person cannot register. My problem is that the version does not correspond

Changing my springboot version to 2.2.5 release can solve the problem

This kind of problem is mainly caused by version mismatch

Mybatis Error setting non null for parameter #15 with JdbcType null Could not set parameters for

Caused by: org.apache.ibatis.type.TypeException: Error setting non null for parameter #15 with JdbcType null . Try setting a different JdbcType for this parameter or a different configuration property. Cause: java.sql.SQLException: Parameter index out of range (15 > number of parameters, which is 14).
	at org.apache.ibatis.type.BaseTypeHandler.setParameter(BaseTypeHandler.java:71)
	at com.baomidou.mybatisplus.core.MybatisDefaultParameterHandler.setParameters(MybatisDefaultParameterHandler.java:227)
	... 88 more
Caused by: java.sql.SQLException: Parameter index out of range (15 > number of parameters, which is 14).

If a comment SQL fragment exists in the SQL code, the #{} parameter cannot be used in the comment SQL fragment. As follows:

        on t1.dealer_code = t4.dealer_code
        -- left join (
        --     select
        --         ads_code
        --        ,sum(case when car like '%MM%' or model = 'MM' then ss_num else 0 end) as ws_MM_num
        --     from abc_assss_ss
        --     where seq = 1 and count_date between '2021-04-01' and '2021-06-30'
        --     group by
        --         dealer_code
        --     )t2
        -- on t1.asd_code = t2.ads_code
        )
        select
      ~~~
      If you replace the between and with the parameter between #{start_time} and #{end_time}, it will report this error, hope it can solve your problem

[Solved] Vue Error: Duplicate keys detected: ‘74004’. This may cause an update error

Problems and Solutions

This may cause an update error

This error indicates that in your V-for loop, key   The value may be duplicate.

Duplicate key will cause rendering errors.

The reason for the error is that I didn’t add the key attribute at the beginning. The error code fragment is as follows:

<template>
    <vue-aplayer
            :audio="audio"
            :lrc-type="3"
            :fixed='fixed'
            :autoplay='autoplay'
            :order='order'
            :volume='volume'
            :theme='theme'
            :listFolded='listFolded '
    />
</template>


No more errors will be reported after adding key

<template>
    <vue-aplayer
            :audio="audio"
            :lrc-type="3"
            :fixed='fixed'
            :autoplay='autoplay'
            :order='order'
            :volume='volume'
            :theme='theme'
            :listFolded='listFolded '
            :key="audio.name"
    />
</template>


Note: audio attribute is the list I want to traverse, and name is the primary key in my list, so here I take audio. Name as the value of key ,   key must be unique.

Official description

key

Expectation: the special attributes of number | string key are mainly used in Vue’s virtual DOM algorithm to identify vnodes when comparing old and new nodes. If you do not use keys, Vue will use an algorithm that minimizes dynamic elements and tries to modify/reuse elements of the same type in place as much as possible. When using a key, it rearranges the order of elements based on the change of the key, and removes elements that do not exist in the key. Child elements with the same parent element must have a unique key. Duplicate keys can cause rendering errors. The most common use case is the combination of V-for :

<ul>
  <li v-for="item in items" :key="item.id">...</li>
</ul>


It can also be used to force replacement of elements/components rather than reuse it. It may be useful when you encounter the following scenarios:

Completely trigger the life cycle hook of the component to trigger the transition, for example:

<transition>
  <span :key="text">{{ text }}</span>
</transition>


When text changes, <span> is always replaced rather than modified, so a transition is triggered.

Android Compile Error: “SSL error when connecting to the Jack server. Try ‘jack-diagnose‘”

The code compilation of 8909 A7 has never been a problem before. Suddenly, one day, the compilation encountered SSL-related errors. The specific errors are as follows:

[  0% 12/6140] Ensure Jack server is installed and started
FAILED: /bin/bash -c "(prebuilts/sdk/tools/jack-admin install-server prebuilts/sdk/tools/jack-launcher.jar prebuilts/sdk/tools/jack-server-4.8.ALPHA.jar  2>&1 || (exit 0) ) && (JACK_SERVER_VM_ARGUMENTS=\"-Dfile.encoding=UTF-8 -XX:+TieredCompilation\" prebuilts/sdk/tools/jack-admin start-server 2>&1 || exit 0 ) && (prebuilts/sdk/tools/jack-admin update server prebuilts/sdk/tools/jack-server-4.8.ALPHA.jar 4.8.ALPHA 2>&1 || exit 0 ) && (prebuilts/sdk/tools/jack-admin update jack prebuilts/sdk/tools/jacks/jack-2.28.RELEASE.jar 2.28.RELEASE || exit 47; prebuilts/sdk/tools/jack-admin update jack prebuilts/sdk/tools/jacks/jack-3.36.CANDIDATE.jar 3.36.CANDIDATE || exit 47; prebuilts/sdk/tools/jack-admin update jack prebuilts/sdk/tools/jacks/jack-4.7.BETA.jar 4.7.BETA || exit 47 )"
Jack server already installed in "/fwork1/yuwl/.jack-server"
Communication error with Jack server (35), try 'jack-diagnose' or see Jack server log
SSL error when connecting to the Jack server. Try 'jack-diagnose'
SSL error when connecting to the Jack server. Try 'jack-diagnose'
[  0% 12/6140] target R.java/Manifest.java: SnapdragonCamera (out/target/common/obj/APPS/SnapdragonCamera_intermediates/src/R.stamp)

Judging from the error log, it was an SSL exception when connecting to the jack server. At first, it was considered to be a jack server problem. The processing process included restarting the jack server service and configuring the jack server port number. It was ineffective. Finally, it was found that many people encountered the same problem through the network. The solutions are as follows. The personal test is effective

Solution:
delete the tlsv1 and tlsv1.1 configurations of the jdk.tls.disabledalgorithms parameter in the/etc/java-8-openjdk/security/java.security file

[Solved] Syntax Error: TypeError: Cannot read property ‘parseComponent‘ of undefined

An error was found while running the Vue project

Syntax Error: TypeError: Cannot read property 'parseComponent' of undefined

Solution: my version numbers of Vue and Vue template compiler are different.

    1. uninstall Vue template compiler first
npm uninstall vue-template-compiler
      1. reinstall NPM uninstall Vue template compiler. The version number is the same as Vue
 npm install [email protected]

Finally, run NPM run serve again

An error occurred during the signature verification in the ROS function pack warehouse

When we install the ros-related packages or perform sudo apt-get update on a linux system with ros installed, the following error will occur:

Get:1 http://packages.ros.org/ros/ubuntu focal InRelease [4,676 B]
Hit:2 http://ports.ubuntu.com/ubuntu-ports focal InRelease
Hit:3 http://ports.ubuntu.com/ubuntu-ports focal-updates InRelease
Hit:4 http://ports.ubuntu.com/ubuntu-ports focal-backports InRelease
Err:1 http://packages.ros.org/ros/ubuntu focal InRelease
The following signatures were invalid: EXPKEYSIG F42ED6FBAB17C654 Open Robotics [email protected]
Hit:5 http://ports.ubuntu.com/ubuntu-ports focal-security InRelease
Fetched 4,676 B in 4s (1,078 B/s)
Reading package lists… Done
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://packages.ros.org/ros/ubuntu focal InRelease: The following signatures were invalid: EXPKEYSIG F42ED6FBAB17C654 Open Robotics [email protected]
W: Failed to fetch http://packages.ros.org/ros/ubuntu/dists/focal/InRelease The following signatures were invalid: EXPKEYSIG F42ED6FBAB17C654 Open Robotics [email protected]
W: Some index files failed to download. They have been ignored, or old ones used instead.

Why does this error occur?
ROS uses the debian package management system to distribute software, so it needs a GPG key to ensure the accuracy and authority of the package, usually the default key expires after about 2 years, so we need to add a new ros related key to it.

How to fix it
Download the certificate and add it.

curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.key
sudo apt-key add ./ros.key

After the installation is successful, the log information of OK will be displayed.

$ sudo apt update
...
 Get:15 http://packages.ros.org/ros/ubuntu focal InRelease [4,676 B] 
...
 Fetched 2,671 kB in 2s (1,607 kB/s)                     
 Reading package lists… Done
 Building dependency tree       
 Reading state information… Done
 30 packages can be upgraded. Run 'apt list --upgradable' to see them.