Tag Archives: bug

Successfully solved the problem of “runtimee” in RESNET dataset classification rror:expected scalar type Long but found Float”

Recently, I encountered some mistakes as shown in the title when doing deep learning classification, but I don’t know how to modify them. Finally, after exploration, I successfully solved them
the problems and solutions are reported directly below.

Error

Solution

In practice, the label of classification should be long, and the image should be float32
therefore, modifying the data type will succeed, but it doesn’t matter. I’ll share it with you after I solve it successfully!

[Python] pip.vendor.urllib3.exceptions.readtimeouterror: httpsconnectionpool protocol

When installing a python module with pip or pychar, you sometimes encounter a readtimeout error. The reason for this problem is probably the network speed

my default source is Tsinghua, sometimes the link network is not good ( the day after the college entrance examination today, it is estimated that there are too many visitors, everyone wants to go to Tsinghua, ha ha ), so I change the source.

pip --default-timeout=100 install pyspark -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com

Perfect solution

[Solved] Ubuntu pyinstaller Error when packaging executable file: … qt.qpa.plugin: Could not find the Qt platform plugin “xcb“ in “…

Ubuntu pyinstaller Error when packaging the executable: … qt.qpa.plugin: Could not find the Qt platform plugin “xcb” in “…
Solution to the problem


Problem
Ubuntu pyinstaller reports an error when packaging the executable: .QFactoryLoader::QFactoryLoader() checking directory path “/home/dyj/CarUI/dist/carmain/platforms” … qt.qpa.plugin: Could not find the Qt platform plugin “xcb” in “” This application failed to start because no Qt platform plugin could be initialized.
Solution
Add the following code to your own main program code.

import os
import PySide2
dirname = os.path.dirname(PySide2.__file__)
plugin_path = os.path.join(dirname, 'plugins', 'platforms')
os.environ['QT_QPA_PLATFORM_PLUGIN_PATH'] = plugin_path

[How to Solve] Content with element type ‘mapper’ must match

Today, in the mapper. XML file, I mistakenly annotated it with /* * code description */ and then reported this error
the specific exception is as follows

Caused by: org.xml.sax.SAXParseException; lineNumber: 134; columnNumber: 10, The element type "mapper" must match "(cache-ref|cache|resultMap*|parameterMap*|sql*|insert*|update*|delete*|select*)+"。

error code 

   /** Public conditions */
    <sql id="commonIfWhere">
        <if test='params.projectId != null and params.projectId != ""'>
            and project_id = #{params.projectId}
        </if>
        <if test='params.id!= null and params.id != ""'>
            and id = #{params.id}
        </if>
    </sql>

after correction

   <!-- Public conditions -->
    <sql id="commonIfWhere">
        <if test='params.projectId != null and params.projectId != ""'>
            and project_id = #{params.projectId}
        </if>
        <if test='params.id!= null and params.id != ""'>
            and id = #{params.id}
        </if>
    </sql>

The problem was solved smoothly

[Solved] There are test failures. Please refer to D:\Java_study\springboot\springboot-sugon-3\target\surefire-reports for the individual test results.

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.2:test (default-test) on project springboot-sugon-3: There are test failures.
Maven error: Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.2:test (default-test) on project springboot-sugon-3: There are test failures.
Please refer to D:\Java_study\springboot\springboot-sugon-3\target\surefire-reports for the individual test results.
Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.**
Solution: Add the following code to pom.xml.

<plugin>  
        <groupId>org.apache.maven.plugins</groupId>  
        <artifactId>maven-surefire-plugin</artifactId>  
        <version>2.22.2</version>  
        <configuration>  
          <skipTests>true</skipTests>  
        </configuration>  
</plugin>  

[Solved] removeerror: ‘requests’ is a dependency of CONDA and cannot be removed from

[Solved]RemoveError: ‘requests’ is a dependency of conda and cannot be removed from conda’s operating environment.

Collecting package metadata: done
Solving environment: done

Downloading and Extracting Packages
certifi-2018.1.18    | 144 KB    | ############################################################################ | 100%
mkl-2018.0.1         | 155.2 MB  | ############################################################################ | 100%
freetype-2.9.1       | 475 KB    | ############################################################################ | 100%
scipy-1.0.0          | 13.0 MB   | ############################################################################ | 100%
......
......
pyparsing-2.3.1      | 54 KB     | ############################################################################ | 100%
kiwisolver-1.0.1     | 60 KB     | ############################################################################ | 100%
qt-5.6.2             | 55.6 MB   | ############################################################################ | 100%
setuptools-38.4.0    | 540 KB    | ############################################################################ | 100%
matplotlib-2.2.2     | 6.5 MB    | ############################################################################ | 100%
six-1.12.0           | 21 KB     | ############################################################################ | 100%
openssl-1.0.2n       | 5.4 MB    | ############################################################################ | 100%
pyqt-5.6.0           | 4.5 MB    | ############################################################################ | 100%
zlib-1.2.11          | 236 KB    | ############################################################################ | 100%
tornado-5.1.1        | 665 KB    | ############################################################################ | 100%
sqlite-3.22.0        | 907 KB    | ############################################################################ | 100%
cycler-0.10.0        | 8 KB      | ############################################################################ | 100%
Preparing transaction: done
Verifying transaction: failed

RemoveError: 'requests' is a dependency of conda and cannot be removed from
conda's operating environment.

conda update --force condaconda update –force conda

How to Solve RemoveError: setuptools is a dependency of conda and cannot be removed from conda

conda remove c> create : conda create : conda create : conda remove : conda create :

RemoveError: ‘setuptools’ is a dependency of Conda and cannot be removed from Conda

I checked a bunch of blogs and they all suggested updating Conda.
conda update --force-reinstall conda
The problem came again. After the command was entered, the process kept spinning in circles, and the terminal did not show any idea of updating. Angry dead an !!!!
I fat tiger not letter can not treat you!!
Solution:
enter the command: gedit. Condarc
the HTTPS instead of HTTP from the original image of the source can be updated again
I will be the original. Condarc file to the following form, for reference only.

ssl_verify: true
channels:
  - http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
show_channel_urls: true

conda update --force-reinstall conda Be able to normal use after
conda remove or conda create command