Tag Archives: Problem solving

[Solved] 1.fatal error: NvInfer.h: No such file or directory

yolov5 compile to generate engine error: /tensorrtx/yolov5/yololayer.h:6:10: fatal error: NvInfer.h: No such file or directory 6 | #include <NvInfer.h>
|          ^~~~~~~~~~~
compilation terminated.

1. The header file and library corresponding to tensorRT were not found.

In CMakeLists.txt
#tensorrt Add tensorrt corresponding header files and link libraries
# tensorrt
#include_directories(/usr/include/x86_64-linux-gnu/)
#link_directories(/usr/lib/x86_64-linux-gnu/)

include_directories(/home/******/TensorRT-7.2.3.4/include)
link_directories(/home/******/TensorRT-7.2.3.4/lib/)

[Solved] An unexpected error has occurred. Conda has prepared the above report.

Problem Description:

Error when using CONDA to create a virtual environment:

An unexpected error has occurred. Conda has prepared the above report. 

Solution:

Method (1): delete the .Condarc file

Method (2): CONDA clean - I

Method (3): after closing your VPN, restart your computer and continue to install the virtual environment

How to Solve Error: RuntimeError: all tensors must be on devices[0]

Problem description

The code running Zheng Zhedong’s aicity2020 reported an error. After searching, it was found that the problem is that the code running is more than GPU, but the specified code is a single GPU

Solution:

In test2020.py, the code comments in lines 126 and 129 are replaced by the following code

# set gpu ids
# if len(gpu_ids)>0:
# torch.cuda.set_device(gpu_ids[0])
# cudnn.benchmark = True
os.environ['CUDA_VISIBLE_DEVICES'] = str(gpu_ids[0])

[Solved] Redis Error: Unexpected exception while processing command

1. Background

Redis has been running for a long time, and an error is reported one day as follows:

2. Phenomenon

org.redisson.client.RedisException: Unexpected exception while processing command
at org.redisson.command.CommandAsyncService.convertException(CommandAsyncService.java:338)
at org.redisson.command.CommandAsyncService.get(CommandAsyncService.java:140)
at org.redisson.RedissonObject.get(RedissonObject.java:90)
at org.redisson.RedissonBucket.set(RedissonBucket.java:131)

3. Solution

Restart the Java application!

What exactly caused it,

You can only guess the link pool of the redis client. Due to network and other reasons, the redis client has not responded for a long time and collapsed!

perfect

Gt Report Error ssh:connect to host github.com port 22

kex_exchange_identification: Connection closed by remote host
Connection closed by 140.82.121.3 port 22
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

  It is suddenly found that git cannot operate, and an error is reported, as shown in the figure above.

Thought the SSH key failed?Check it. It’s corresponding.

Testing

$   ssh -T   [email protected]

The result is still  

Internet search method:

Test port 443 can be successful  

$ ssh -T -p 443 [email protected]

Referring to the online method, the solution is as follows:

  Locate git’s config file  /etc/ssh/ssh_ Config and edit

$   vi /etc/ssh/ssh_ config     

If you don’t have permission, use sudo

Add the following code at the end and save

Host github.com
User git
Hostname ssh.github.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa
Port 443

success!  

Then you can operate git normally!

Plugin Error: Plugin “Android Code Generator“ is incompatible (supported only in IntelliJ IDEA)

1. Question

Plugin Error: Plugin “Android Code Generator” is incompatible (supported only in IntelliJ IDEA).

2. Solution

C:/Users/Admin/AppData/Roaming/Google/AndroidStudio4.2/plugins

After deleting the file, restart the as to solve the problem.

3. Detailed steps

1. Enter the directory of Disk C and click the [user] folder

2. Find the directory of your [administrator] user name, that is, admin above

3. If you enter at this time, you may not find the appdata folder, so you need to open the hidden directory to see it (take win10 as an example here)

4. Follow the above file path to find the directory where the file is located

5. Delete the error folder. This is Android codegenerator plugin IntelliJ

6. Restart Android studio

Local repository upload to remote repository error: failed to push some refs to ‘https://hub.fastgit.org/zhizhangxuezhang/ui-test.git‘

There is an error in pushing from the local warehouse to the remote warehouse (rejected) because the code of the remote warehouse has been modified directly in the remote warehouse. At this time, the code of the local warehouse is different from that of the remote warehouse, so you must update the code of the local warehouse (Pull) first and then submit (push)

Error log in idea for this problem:

error log in Git bash:

at this time, you can only pull to update your local warehouse and then push to the remote warehouse, but you will find that you will also report an error when you pull to the local warehouse


at this time, your pull command should be changed to the following command, That is, just add a parameter to ignore the history (because the two branches are caused by different versions)

git pull origin master --allow-unrelated-histories

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘use

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userController': Unsatisfied dependency expressed through field 'userMapper'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userMapper' defined in file [E:\ProjectTest\IdeaProject\DVillages\target\classes\com\xh\mapper\UserMapper.class]: Unsatisfied dependency expressed through bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [org/mybatis/spring/boot/autoconfigure/MybatisAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.ibatis.session.SqlSessionFactory]: Factory method 'sqlSessionFactory' threw exception; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: 'file [E:\ProjectTest\IdeaProject\DVillages\target\classes\mybatis\mapper\supervise\ComplaintMailbox.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. The XML location is 'file [

Before XML modification of SQL statement:

after modification

the reason is the wrong parametertype

Error creating bean with name ‘servletEndpointRegistrar‘ defined in class path resource

The errors encountered in writing as service items today are shown below. I only know that the creation of error creating bean with name ‘servletendpointregistrar’ defined in class path resource failed. I also found some solutions on the Internet. The most common solutions are that there is a lack of JDBC dependency, or that the database configuration file is wrong. I also compared the database, There is no lack of JDBC dependency, which shows that my database and dependency are correct. I compared other service services and found that more configuration files were introduced into the configuration file

[${project.name}] 2021-09-10 23:21:44,213 ERROR [localhost-startStop-1][Jdk14Logger.java:87] - Error starting Tomcat context. Exception: org.springframework.beans.factory.UnsatisfiedDependencyException. Message: Error creating bean with name 'servletEndpointRegistrar' defined in class path resource [org/springframework/boot/actuate/autoconfigure/endpoint/web/ServletEndpointManagementContextConfiguration.class]: Unsatisfied dependency expressed through method 'servletEndpointRegistrar' parameter 0; nested exception is org.springframework.boot.context.properties.ConfigurationPropertiesBindException: Error creating bean with name 'management.endpoints.web-org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointProperties': Could not bind properties to 'WebEndpointProperties' : prefix=management.endpoints.web, ignoreInvalidFields=false, ignoreUnknownFields=true; nested exception is org.springframework.boot.context.properties.bind.BindException: Failed to bind properties under 'management.endpoints.web.exposure' to org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointProperties$Exposure
[${project.name}] 2021-09-10 23:21:44,240 WARN [main][Jdk14Logger.java:87] - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat
[${project.name}] 2021-09-10 23:21:44,241 INFO [main][DubboGenericServiceFactory.java:159] - The Dubbo GenericService ReferenceBeans are destroying...
[${project.name}] 2021-09-10 23:21:44,245 INFO [main][Jdk14Logger.java:87] - class org.apache.dubbo.config.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor was destroying!

My Nacos profile is

#HTTP format configuration spring:
http:
  encoding:
    charset: UTF‐8
    force: true
    enabled: true
  messages:
    encoding: UTF‐8
#tomcat header information (user ip and access protocol) and access path configuration
server:
  tomcat:
    remote_ip_header: x‐forwarded‐for
    protocol_header: x‐forwarded‐proto
  servlet:
    context‐path: /lifly
  use‐forward‐headers: true

#Service monitoring and management configuration, operation and maintenance related
management:
  endpoints:
    web:
      exposure:
      include: refresh,health,info,env

This configuration file defines the user IP and access path, as well as some configuration files related to service monitoring, management and operation and maintenance. However, the remote call is not used in the service, but I introduced this configuration file. The reason for my error is this, so I recorded it
My bootstrap.yml configuration file is as follows:

server:
  port: 56050 
nacos:
  server:
    addr: 127.0.0.1:8848
spring:
  application:
    name: transaction-service
#  main:
#    allow-bean-definition-overriding: true # Spring Boot 2.1 
  cloud:
    nacos:
      discovery:
        server-addr: 127.0.0.1:8848
#        server-addr: ${nacos.server.addr}
        namespace: 339eea59-f7f4-44d0-a3fa-9f1f85bd5b4f
#        cluster-name: COMMON_GROUP
      config:
        server-addr: 127.0.0.1:8848
#        server-addr: ${nacos.server.addr} 
        file-extension: yaml
        namespace: 339eea59-f7f4-44d0-a3fa-9f1f85bd5b4f  
        group: DEFAULT_GROUP 
        ext-config:
          -
            refresh: true
            data-id: spring-boot-http.yaml # spring boot http
            group: COMMON_GROUP 
#          -
#            refresh: true
#            data-id: spring-boot-starter-druid.yaml # spring boot starter druid
#            group: COMMON_GROUP 
#          -
#            refresh: true
#            data-id: spring-boot-mybatis-plus.yaml # spring boot mybatisplus
#            group: COMMON_GROUP 
#          - refresh: true
#            data-id: spring-boot-redis.yaml 
#            group: COMMON_GROUP 
  datasource:
    driver-class-name: com.mysql.jdbc.Driver
    url: jdbc:mysql://localhost:3306/huiminpay_transaction?useUnicode=true&useSSL=false
    #  url: jdbc:mysql://localhost:3306/huiminpay_merchant_service?characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&rewriteBatchedStatements=true&useUnicode=true
    username: root
    password: 1234
mybatis-plus:
  type-aliases-package: com.huiminpay.transaction.entity
  mapper-locations: classpath:/mapper/*.xml

dubbo:
  scan:
    # dubbo 
    base-packages: com.huiminpay
  protocol:
    # dubbo 协议
    name: dubbo
    port: 20893
  registry:
    address: nacos://127.0.0.1:8848
  application:
    qos:
      port: 22250 # dubbo qos
  consumer:
    check: false
    timeout: 3000
    retries: -1

logging:
  config: classpath:log4j2.xml

I commented out the import file and the project started. Record it again, and I hope it will be helpful to you. Comment out the following import file

 ext-config:
          -
            refresh: true
            data-id: spring-boot-http.yaml # spring boot http set
            group: COMMON_GROUP 

[Solved] PHP Fatal error: Uncaught Error: Class ‘Redis‘ not found in

The problem is that the redis class cannot be captured in the message

However, I have installed redis and used it in PHP code, but when I execute PHP jifen.php in Linux system, I report that redis class cannot be found.

Solution:

First, determine if there are two PHP in your system.

find/-name php

Then find your current PHP Directory:

Use phpinfo () in the PHP file; Method, you can access it

My PHP files are at /www/server/PHP/73/

Modify the system environment file:/etc/profile

vi /etc/profile

Write the PHP environment address to the end of the configuration file


The PHP runtime files are inside the bin directory, so mine is: /www/server/php/73/bin/

export PATH=$PATH:your PHP address

Save, exit, and then run:

source /etc/profile

Restart the PHP file to use PHP jifen.php

 

[Solved] PostgreSQL Remote Access Error: could not connect to server

1. Turn off the postgresql service first
. 2. If you want postgresql to support remote access, you need to modify the two configuration files in the data folder under the directory

postgresql.conf
Set the value of the listen_addresses item in the file to ‘*’
pg_hba.conf
Add the following configuration under the host all all 127.0.0.1/32 md5 line after the ipv4 configuration of the configuration file, or directly modify this line to the following configuration host all 0.0.0.0/0 trust
If you do not want to allow all IP remote access, You can set 0.0.0.0 in the above configuration items to a specific IP value.
3. Right-click management on my computer-find service-find postgresql service, right-click to start

[Solved] org.thymeleaf.exceptions.TemplateInputException: Error resolving template

report errors:

org.thymeleaf.exceptions.TemplateInputException: Error resolving template [queryUserList], template might not exist or might not be accessible by any of the configured Template Resolvers
	at org.thymeleaf.engine.TemplateManager.resolveTemplate(TemplateManager.java:869) ~[thymeleaf-3.0.12.RELEASE.jar:3.0.12.RELEASE]
	at org.thymeleaf.engine.TemplateManager.parseAndProcess(TemplateManager.java:607) ~[thymeleaf-3.0.12.RELEASE.jar:3.0.12.RELEASE]
	at org.thymeleaf.TemplateEngine.process(TemplateEngine.java:1098) ~[thymeleaf-3.0.12.RELEASE.jar:3.0.12.RELEASE]
	at org.thymeleaf.TemplateEngine.process(TemplateEngine.java:1072) ~[thymeleaf-3.0.12.RELEASE.jar:3.0.12.RELEASE]
    1. when the controller layer finished processing the request and returned, it did not use @Restcontroller or @ResponseBody but returned a non JSON format
    1. in this case, the returned data thymeleaf template cannot be parsed and an error is directly reported. I officially reported an error for this reason

Solution: you can change @Controller to @Restcontroller, but you should pay attention to whether other methods return HTML pages, which will result in string instead of page; The best way is to add a @ResponseBody to the requested method.

      1. when the corresponding method of your controller layer returns the HTML path and name, add an additional /

For example, return “/ index”. If this/causes an error, the solution is to remove the/in front of the return, such as return “/ index”.

        1. in the process of using springboot, if thymeleaf is used as the template file, the HTML format must be strict HTML5 format and there must be an end tag, otherwise an error will be reported</ ol>

The solution is as follows:
add the following configuration in application.yml

spring.thymeleaf.content-type: text/html 
spring.thymeleaf.cache: false 
spring.thymeleaf.mode: LEGACYHTML5

Add the following dependencies in pom.xml

<dependency> 
<groupId>net.sourceforge.nekohtml</groupId> 
<artifactId>nekohtml</artifactId> 
<version>1.9.22</version> 
</dependency> 

The path of the

          1. resource file has been modified. If your other requests return normally, you can ignore this one

Solution: add in the of pom.xml file

<resource>
 <directory>src/main/resources</directory>
</resource>