Category Archives: How to Fix

A solution to the kernel error of Jupiter notebook in Anaconda under Windows 10

Problem Description:

                After installing Anaconda 3, open the Jupiter notebook to create a new one. When you click Python 3, the kernel error is always displayed. It has been tried several times. I believe many people have such a problem. No matter uninstalling and reloading Anaconda or rebuilding an environment, it has not been solved. Until later, it was found that the nuclear was not cleaned up. Here I share a solution to this problem. Successfully solved my problem.

solve:

1. Open the anaconda prompt window and enter Jupiter kernelspec list to see the location of the current kernel. Note that this is the wrong kernel,

 

2. Copy this address and uninstall the current anaconda

3. Find the address just now and delete the jupyter folder

4. Reinstall Anaconda

It can be solved!!

 

 

Linunx—@ error/constitute.c/WriteImage/1037.

Learn ROS in linunx system. During the programming process of testing publisher publisher, execute ‘learn’ to be tested_ The following error occurred while publishing. Py ‘file:

resolvent:

In ‘learn_ Add code on the first line of the publish. Py ‘file: #/ Usr/bin/env python, click “save” in the upper right corner after adding.

The operation is as follows:

           

 

[system]SyntaxError: Unexpected token u in JSON at position 0

It was another day when I was annoyed by the bug. The error reports were as follows:

annotated all the codes, debugged them one by one, and finally found the error location:

after consulting the data, I found that JSON. Parse() can only process JSON format. If no item is passed in, it is equivalent to processing null values, Therefore, you can make a judgment before processing:

there is no problem.

Keyerror occurred when openpyxl copied some excel with pictures:. MPO‘

Solution
add the following code to the PY header of the operation picture:

from PIL import JpegImagePlugin
JpegImagePlugin._getmp = lambda  x:None

mime = mimetypes.types_ Map [true] [ext]
keyerror: ‘. MPO’
the above error occurs when using openpyxl to operate the pictures in Excel. Baidu has not. After a visit to Google, it is found that there is an image MIME type of. MPO, and the pictures in my excel are clearly in. PNG format
examples are as follows:

>>> import PIL.Image
>>> img = PIL.Image.open('bob a.jpg')
>>> img.format
'MPO'
>>> PIL.PILLOW_VERSION
'2.7.0'

First of all, you should know that openpyxl uses pilot to identify images. After Google found that this PNG image is recognized as an. MPO file by pilot, Openpyxl does not support
while images in MPO format are very similar to JPEG images
it may be that an additional flag is added when the pilot recognition format is JPEG or PNG and marked as MPO
so we can add the above two lines of code before importing any image and before the pilot recognition image (I don’t know what he means. The jpeimageplugin is used by the pilot to process images. It should not add any suffix to the source image).

Reference link
using openpyxl: keyerror: ‘. MPO’ while saving excel workbook
k
JPEG image being identified as MPO

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

Error message

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'lettuceClientResources' defined in class path resource [org/springframework/boot/autoconfigure/data/redis/LettuceConnectionConfiguration.class]: Bean instantiation via factory method failed; ....

You can see that redis appears in the message. The reason for my error is that the dependency of spring boot starter data redis is added to the pom.xml file, but the redis connection information is not configured.

SyntaxError: (unicode error) ‘unicodeescape‘ codec can‘t decode bytes in position 2-3: truncated \UX

Open a named PI with absolute path under windows_ The file of digits.txt has an error

Because the resource of the path cannot be found after escape.

To change a \ in the absolute path to\\  

This is the path before the error is reported.

The path that runs successfully after modification.

  Moreover, it can be found that it is not necessary to replace all \ \, replace the front with \ \, and run without changing the back.

Ubuntu20.04 Installing WslRegisterDistribution failed with error: 0xc03a001a

After installing Ubuntu in the software store, the following prompt appears after opening, indicating that you have compressed the file to save space (if two opposite blue arrows appear in the upper right corner of your file, you have enabled this function).

Installing, this may take a few minutes...
WslRegisterDistribution failed with error: 0xc03a001a
Error: 0xc03a001a ???????????????????????????????????????????????????

Solution:

1. Go to the C: \ users \ user name \ appdata \ local \ packages folder. If you can’t find some files that may be hidden files, you need to click View in the file manager and select the option of hidden items.

  2. Enter the directory and enter “Ubuntu” to search the subdirectory.

3. After finding the subdirectory, right-click properties & gt& gt; Advanced & gt& gt; Uncheck compressed content to save disk space & gt& gt; determine

4. The blue arrow on the file disappears and it’s OK.

ERROR StatusLogger No Log4j 2 configuration file found

terms of settlement:

In IntelliJ idea:

    in SRC – & gt; Create a new folder resources under main create a new log4j2.xml file

    <?xml version="1.0" encoding="UTF-8"?>
    <Configuration>
        <Appenders>
            <Console name="STDOUT" target="SYSTEM_OUT">
                <PatternLayout pattern="%d %-5p [%t] %C{2} (%F:%L) - %m%n"/>
            </Console>
        </Appenders>
        <Loggers>
            <Logger name="com.opensymphony.xwork2" level="info"/>
            <Logger name="org.apache.struts2" level="info"/>
            <Logger name="org.demo.rest" level="debug"/>
            <Root level="warn">
                <AppenderRef ref="STDOUT"/>
            </Root>
        </Loggers>
    </Configuration>

elasticsearch NoClassDefFoundError error creating RestHighLevelClient bean

NoClassDefFoundError is usually a configuration error – which means that the code you use refers to a class, but the class itself is not in the classpath. In this case, this may also be a dependency management error in the relevant elasticsearch POMS itself, because it should contain the required classes

        <dependency>
            <groupId>org.elasticsearch.client</groupId>
            <artifactId>elasticsearch-rest-high-level-client</artifactId>
            <version>7.6.2</version>
        </dependency>
        <dependency>
            <groupId>org.elasticsearch.client</groupId>
            <artifactId>elasticsearch-rest-client</artifactId>
            <version>7.6.2</version>
        </dependency>
        <dependency>
            <groupId>org.elasticsearch</groupId>
            <artifactId>elasticsearch</artifactId>
            <version>7.6.2</version>
        </dependency>

Complete dependency, OK
(pay attention to switching to your own version)
maybe your mood is broken at the moment. Don’t worry. I believe it will bring you good luck _

RuntimeError: cuDNN error: CUDNN_STATUS_EXECUTION_FAILED

RuntimeError: cuDNN error: CUDNN_ STATUS_ EXECUTION_ FAILED

The error is in   cuda:10.0     Pytorch: 1.2 problems in the training model under the GPU server environment, error prompt   Cudnn status execution failed

The problem with this error is that CUDA’s version does not correspond to pytorch’s version, resulting in CUDA’s failure to speed up model training and execute at the same time.

When downloading pytorch, we need to correctly download the corresponding relationship between pytorch and CUDA version on the official website. In the local training model, my environment is CUDA 10.0 and pytorch 1.9. Therefore, reinstall pytorch version 1.9 in the server and run successfully.

Performance: CUDA’s version does not correspond to pytorch’s version. The most obvious performance is that when running the program, the video memory does not change. When the normally loaded data and model enter the video memory, the video memory will increase significantly, while when the version does not correspond, the video memory does not change significantly. At the same time, the program will be very slow when loading the model, and even the model cannot be loaded into the video memory for 20 minutes.