Category Archives: Error

[Solved] OMP: Error #15: Initializing libiomp5md.dll, but found libiomp5md.dll already initialized.

Error 1. OMP: Error #15: Initializing libiomp5md.dll, but found libiomp5md.dll already initialized.
Error Message:

OMP: Error #15: Initializing libiomp5md.dll, but found libiomp5md.dll already initialized.
OMP: Hint This means that multiple copies of the OpenMP runtime have been linked into the program. That is dangerous, since it can degrade performance or cause incorrect results. The best thing to do is to ensure that only a single OpenMP runtime is linked into the process, e.g. by avoiding static linking of the OpenMP runtime in any library. As an unsafe, unsupported, undocumented workaround you can set the environment variable KMP_DUPLICATE_LIB_OK=TRUE to allow the program to continue to execute, but that may cause crashes or silently produce incorrect results. For more information, please see http://www.intel.com/software/products/support/.

Solution 1:

When debugging a program in pycharm, you can directly add these two statements in front of the program

import os
os.environ[“KMP_DUPLICATE_LIB_OK”]=“TRUE”

Solution 2:

If Method 1 fails to solve the problem, even importing torch directly on the terminal will cause this problem:

The reason for this is actually that there are two libiomp5md.dll files in the environment of anaconda. So go directly to the path of the virtual environment and search for this file, you can see that there are two dll files in the environment.

The first one is in the path of torch, and the second one is in the path of virtual environment itself. Go to the second directory and cut it to other paths for backup (it is better to back up the path as well).

Error 2.ModuleNotFoundError: No module named ‘mmcv._ext ‘

When using the target detection open source tool MMDetection, the following error occurs:

ModuleNotFoundError: No module named 'mmcv._ext'

It is likely that you did not specify a version when you started the installation of mmcv-full and chose to install it directly, as follows:

pip install mmcv-full

By default, mmcv full is installed. If it does not match the cuda and torch versions in your environment, the above error is likely to occur

Uninstall the original mmcv

pip uninstall mmcv-full

Reinstall the correct version of mmcv full

where {cu_version}, {torch_version} correspond to the version numbers of cuda and torch respectively

pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/{cu_version}/{torch_version}/index.html

For example, I installed cuda10.2 and pytorch 1.8.0, so I should enter the command:

pip install mmcv-full==1.2.4 -f https://download.openmmlab.com/mmcv/dist/cu102/torch1.8.0/index.html

Note: mmcv-full I recommend version 1.2.4.

[Solved] LaTeX Error: File ‘‘picins.sty‘‘ not Found.

What should I do if latex is running fine in the early stages, but suddenly it doesn’t work and shows that an important file is missing? Here we take “picins.sty” as an example.

Most of the problems can be solved by the following method.
It would be more accurate to put the two .sty files in the tex/latex/picins directory, the .dvi and .doc files in the doc/latex/picins directory, and the rest of the files in the source/latex/picins directory. The above refers to its directory tree in MiKTeX. However, it was found that the corresponding picins folder could not be found, so you need to complete it manually, as follows.

Step 1, check if the picins folder is missing under texlive’s folder, tex/latex/picins directory and doc/latex/picins directory and source/latex/picins directory.

Step 2: If not, copy the downloaded and unzipped picins folder to the above three directories.

Step 3, press win+R at the same time, execute cmd command, type “texhash” to update the database of tex.

The above three steps will solve the problem that the file does not exist.

[Solved] MDK Compile Error: error:No section matches selector – no section to be FIRST/LAST

In the process of using MDK, the compilation found that the error: No section matches selector – no section to be FIRST/LAST is generated, which means that the system driver file, i.e. .s file, is missing from the project.

There are two cases of missing .s files.

1. The .s file has not been added. If the .s file is not added, the .s file can be added to CMSIS (normally, under normal circumstances, the .s file is directly available in MDK_ARM), and after it is added, the compilation is successful.

In the process of adding .s file: find the left column at the main function .c file, and click Add in the file where it is located (file type click .s file for easy finding) .s file.

2. No .s file is generated. This error usually occurs when using MDK for the first time, usually because the file where the mdk’s keil is located is not in the same folder as the project file created. Just move the created project file into the mdk file.

[Solved] STM32 Use DAP to Download Error: Error: Flash Download failed – “Cortex-M3“

When using the DAP of wildfire, there is a problem in the title, and there is no Autodetect option in Magic Wand/Debug/Reset.

The Enable option in the pack needs to be removed.

At this time, the Autodetect option appears. Select this option, and the title problem will not occur again.

[Solved] error: invalid operands of types ‘const char [6]‘ and ‘const char [6]‘ to binary ‘operator+‘

 

preface

When using strings in C++, we habitually use + to connect two strings enclosed in "". The error is reported: error: invalid operators of types' const char [6] 'and' const char [6] 'to binary' operator+',


1. Scenarios

	//std::string str = "hello" + "world"; // error: invalid operands of types 'const char [6]' and 'const char [6]' to binary 'operator+'
	//std::string str = std::string("hello") + " world"; // correct
	//std::string str = "hello" + std::string("world"); //correct
	std::string str = "hello"" world"; //correct

    cout << "str=" << str << endl;

When using the+operator to connect two strings wrapped with "", an error occurs. The reason is that in C++, the strings enclosed by "" are regarded as const char* types, rather than string types.

2. Solution

Refer to the explanation on stackoverflow. For details, please read error: invalid operators of types’ const char * ‘and’ const char * ‘to binary’ operator+’

1. Explicitly declare one of them as std::string type (recommended)

std::string str = std::string("hello") + " world";

2. Remove the+and let the compiler splice strings (not recommended)

std::string str = "hello"" world";

Most compilers automatically splice strings enclosed by "", but it is not guaranteed that all compilers are normal. It is recommended to display strings declared as string types and then perform the+operation.


3. Validation

	std::string str1 = std::string("hello") + " world" + "!"; // correct
    std::string str2 = "hello" + std::string(" world") + "!"; //correct
    std::string str3 = "hello"" world" "!"; //correct

    cout << "str1=" << str1 << endl;
    cout << "str2=" << str2 << endl;
    cout << "str3=" << str3 << endl;

[Solved] AttributeError: module ‘keras.preprocessing.image‘ has no attribute ‘load_img‘

Original code:

from keras.preprocessing import image
img         =   image.load_img(img_path,target_size=(224,224))
x           =   image.img_to_array(img)

report errors:

AttributeError: module 'keras.preprocessing.image' has no attribute 'load_img'

Reason: The keras version has been updated.

Solution:

from keras.utils import image_utils
img         =   image_utils.load_img(img_path,target_size=(224,224))
x           =   image_utils.img_to_array(img)

Two Way Communication Error: Function two_way_comm_post_message / two_way_comm_post_message_ex faile

Fangfa project scenario:

lr runs 1000 concurrent operations for 20 minutes, and some errors occur during execution


Problem description

The error message is as follows: a small number of errors are reported as follows:

Error: Two Way Communication Error: Function two_way_comm_post_message / two_way_comm_post_message_ex failed.

Error: Failed to deliver a p2p message from parent to child process, reason - communication error.

 


Cause analysis:

Generally, there is no specific prompt information. Considering that it is a problem with the press, the concurrency is too large to handle


Solution:

Method 1: You need to modify the dat file in two locations

1. C:\Program Files (x86)\HP\LoadRunner\launch_service\dat\channel_configure.dat

2. C:\Program Files (x86)\HP\LoadRunner\dat\channel_configure.dat

Method 2: Add a press.

rsyslog Write into Log File Error [How to Solve]

1. Use logger to send system notification logs,

[root@Infor-test01 ~]# logger cccccccaaaaaaaadddddddd

 

The error message is also written to the log,

 

 Modify the type, and modify the permission 777. :

The most important one is the type tag of the file. For example, the httpd process can only run in httpd_t, and /etc/passwd only has type

It can only work for passwd_file_t. If the /var/log/messages file is not of type var_log_t, it will not be able to record logs, etc.

In the SELinux security policy, the type type is modified, which may cause the file to fail to be used normally .

[Solved] Redisson distributed lock error: attempt to unlock lock, not locked by current thread by node id

java.lang.IllegalMonitorStateException: attempt to unlock lock, not locked by current thread by node id: 193fa0a4-1df0-445f-8737-18b7bb464f64 thread-id: 80

When the Redission distributed lock performs the unlock operation, there is an abnormal source code as follows:

public void unlock() {
        try {
            this.get(this.unlockAsync(Thread.currentThread().getId()));
        } catch (RedisException var2) {
            if (var2.getCause() instanceof IllegalMonitorStateException) {
                throw (IllegalMonitorStateException)var2.getCause();
            } else {
                throw var2;
            }
        }
    }
public RFuture<Void> unlockAsync(long threadId) {
        RFuture<Boolean> future = this.unlockInnerAsync(threadId);
        CompletionStage<Void> f = future.handle((opStatus, e) -> {
            this.cancelExpirationRenewal(threadId);
            if (e != null) {
                throw new CompletionException(e);
            } else if (opStatus == null) {
                IllegalMonitorStateException cause = new IllegalMonitorStateException("attempt to unlock lock, not locked by current thread by node id: " + this.id + " thread-id: " + threadId);
                throw new CompletionException(cause);
            } else {
                return null;
            }
        });
        return new CompletableFutureWrapper(f);
    }

Why is this happening, because when the lock operation is performed, a time is set

1. After you complete the lock, when the execution time of the business code in it is greater than the lock time, and unlock it, the exception will be thrown

2. The problem of multi-thread competition. When the first thread completes the lock, it is not unlocked at this time. In this way, the second thread tries to acquire the lock and perform the lock operation, and this exception will be thrown.

Solution:

Before locking or unlocking, it is enough to judge the legality of the state, instead of directly performing the locking and unlocking operation.

[Solved] STS Console Error: error unknown mavem Maven Configuration Problem

Description Resource Path Location Type Unknown pom.xml /decision line 1 Maven Configuration Problem

Solution:
Add the following line, and then execute maven update, just fine, I don’t know why.

<packaging>war</packaging>

E.g:

<groupId>com.xxx</groupId>
<artifactId>xxx</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>