Author Archives: Robins

[Solved] Vue-cli Create Project Error: ERROR command failed: yarn

Create a project through vue-cli, and the error ERROR command failed: yarn is reported

reason:

Installed yarn package manager When creating a vue project, you choose to use yarn package manager, but when creating a project through vue-cli, you use npm, causing a conflict

Solution:

The path to open the document is:C:\Users\Administrator\.vuerc

Note: If you don’t see it, check the hidden items at the top in Explorer
Open the folder and replace yarn with npm
Solve the problem and recreate the item

[Solved] fatal: not in a git directory Error: Command failed with exit 128: git

fatal: not in a git directory Error: Command failed with exit 128: git

brew install cmake  execute error:

Already downloaded: /Users/kingcall/Library/Caches/Homebrew/downloads/b7ef8d6eb909e967d072212c62e71bfb8e94e6227ae2d3567bbabcc561fd9fff--cmake-3.21.4.bottle_manifest.json
==> Downloading https://ghcr.io/v2/homebrew/core/cmake/blobs/sha256:c86a0bb0e37c293e2d4475519d28f2784c430e871f74969a1a2afeb64b540a7d
Already downloaded: /Users/kingcall/Library/Caches/Homebrew/downloads/1e8ca69a4444469a3f380baf4e514072d4d0f0b5d5ccd43b8ce3eb68081eff3d--cmake--3.21.4.arm64_monterey.bottle.tar.gz
fatal: not in a git directory
Error: Command failed with exit 128: git

The solution is as follows:

Running brew -v will give you two prompts to set the file paths for homebrew-cask and homebrew-core to safe.directory, i.e. using the following names.

Follow the prompts

git config --global --add safe.directory /opt/homebrew/Library/Taps/homebrew/homebrew-core
git config --global --add safe.directory /opt/homebrew/Library/Taps/homebrew/homebrew-cask

Then executearch -arm64 brew install cocoapods will be OK!

If the above error is encountered, follow the prompts

git config --global --add safe.directory /opt/homebrew/Library/Taps/homebrew/homebrew-services

Then execute arch -arm64 brew install cocoapods again to succeed.

After successful execution, we execute our installation command againbrew install cmake

[Solved] VsCode + gfortran Compiler Error: error: ld returned 1 exit status

After a file is executed in the VsCode control panel, if a new f90 file is created (multiple programs share the same panel port), an error message as shown in the figure will often appear

Solution:
The tasks.json file should add the presentation property `

{
    "version": "2.0.0",
    "tasks": [
      {
        "label": "compile",
        "type": "shell",
        "command": "gfortran",
        "args": [
          "-g",
          "${file}",
          "-o",
          "${workspaceRoot}\\${fileBasenameNoExtension}.exe"
        ],
        "problemMatcher": [],
        "group": {
          "kind": "build",
          "isDefault": true
        },
        "presentation": {
          "echo": true,
          "reveal": "always",
          "focus": false,
          "panel": "new", //Here shared means shared, after changing to new each process creates a new port
          "showReuseMessage": true,
          "clear": false
        }
      }
    ]
  }

“Shared” indicates sharing. After changing to new, each process creates a new port.

[Solved] cv2.error: OpenCV(4.6.0) D:\a\opencv-python\opencv-python\opencv\modules\……

Project Scenarios

Run the opencv official website example code facedetect.py

#!/usr/bin/env python

'''
face detection using haar cascades

USAGE:
    facedetect.py [--cascade <cascade_fn>] [--nested-cascade <cascade_fn>] [<video_source>]
'''

# Python 2/3 compatibility
from __future__ import print_function

import numpy as np
import cv2 as cv

# local modules
from video import create_capture
from common import clock, draw_str


def detect(img, cascade):
    rects = cascade.detectMultiScale(img, scaleFactor=1.3, minNeighbors=4, minSize=(30, 30),
                                     flags=cv.CASCADE_SCALE_IMAGE)
    if len(rects) == 0:
        return []
    rects[:,2:] += rects[:,:2]
    return rects

def draw_rects(img, rects, color):
    for x1, y1, x2, y2 in rects:
        cv.rectangle(img, (x1, y1), (x2, y2), color, 2)

def main():
    import sys, getopt

    args, video_src = getopt.getopt(sys.argv[1:], '', ['cascade=', 'nested-cascade='])
    try:
        video_src = video_src[0]
    except:
        video_src = 0
    args = dict(args)
    cascade_fn = args.get('--cascade', "data/haarcascades/haarcascade_frontalface_alt.xml")
    nested_fn = args.get('--nested-cascade', "data/haarcascades/haarcascade_eye.xml")

    
    cascade = cv.CascadeClassifier(cv.samples.findFile(cascade_fn))
    nested = cv.CascadeClassifier(cv.samples.findFile(nested_fn))
    cam = create_capture(video_src, fallback='synth:bg={}:noise=0.05'.format(cv.samples.findFile('data/lena.jpg')))#此处的data文件夹是从opencv示例simple包中复制到该项目中。

    
    while True:
        _ret, img = cam.read()
        gray = cv.cvtColor(img, cv.COLOR_BGR2GRAY)
        gray = cv.equalizeHist(gray)

        t = clock()
        rects = detect(gray, cascade)
        vis = img.copy()
        draw_rects(vis, rects, (0, 255, 0))
        if not nested.empty():
            for x1, y1, x2, y2 in rects:
                roi = gray[y1:y2, x1:x2]
                vis_roi = vis[y1:y2, x1:x2]
                subrects = detect(roi.copy(), nested)
                draw_rects(vis_roi, subrects, (255, 0, 0))
        dt = clock() - t

        draw_str(vis, (20, 20), 'time: %.1f ms' % (dt*1000))
        cv.imshow('facedetect', vis)

        if cv.waitKey(5) == 27:
            break

    print('Done')

if __name__ == '__main__':
    print(__doc__)
    main()
    cv.destroyAllWindows()

Problem description

Running the above code reports the following error:

[ WARN:[email protected]] global D:\a\opencv-python\opencv-python\opencv\modules\core\src\utils\samples.cpp (61) cv::samples::findFile cv::samples::findFile('data/haarcascades/haarcascade_frontalface_alt.xml') => ''
Traceback (most recent call last):
  File "E:\Pycharm\Pycharm7\facedetect.py", line 81, in <module>
    main()
  File "E:\Pycharm\Pycharm7\facedetect.py", line 48, in main
    cascade = cv.CascadeClassifier(cv.samples.findFile(cascade_fn))
cv2.error: OpenCV(4.6.0) D:\a\opencv-python\opencv-python\opencv\modules\core\src\utils\samples.cpp:64: error: (-2:Unspecified error) OpenCV samples: Can't find required data file: data/haarcascades/haarcascade_frontalface_alt.xml in function 'cv::samples::findFile'

Cause analysis:

According to the error location:

cascade = cv.CascadeClassifier(cv.samples.findFile(cascade_fn))

It can be found that the file paths of “haarcascade_frontalface_alt.xml” and “data/haarcascades/haarcascade_eye.xml” are not correct.


Solution:

“haarcascade_frontalface_alt.xml” and “data/haarcascades/haarcascade_eye.xml” are under the cv2 package installed in python, just change the path in the code to a relative path.

The code is changed as follows:

cascade_fn = args.get('--cascade', "D:/Python/yingyong/Lib/site-packages/cv2/data/haarcascades/haarcascade_frontalface_alt.xml")
    nested_fn  = args.get('--nested-cascade', "D:/Python/yingyong/Lib/site-packages/cv2/data/haarcascades/haarcascade_eye.xml")

Run again to run normally.

[Solved] Error: L6218E: Undefined symbol vApplicationGetIdleTaskMemory (referred from tasks.o).

I am using F103ZET6 board, after successful porting

I got two errors in stm32f10x_it.c

void SVC_Handler(void)

void PendSV_Handler(void)

Occupancy problem of two functions

Then the following two problems appeared in the compilation:

..\OBJ\LED.axf: Error: L6218E: Undefined symbol vApplicationGetIdleTaskMemory (referred from tasks.o).

..\OBJ\LED.axf: Error: L6218E: Undefined symbol vApplicationGetTimerTaskMemory (referred from timers.o).

 

Including the header file and the path of the header file

That’s a program error

The method is simple:

In FreeRTOS

Cancel the static memory request of FreeRTOS

#define configSUPPORT_DYNAMIC_ALLOCATION        1                       //Support for dynamic memory requests
#define configSUPPORT_STATIC_ALLOCATION 1 //Support static memory requests
#define configTOTAL_HEAP_SIZE ((size_t)(20*1024)) //System all heap size

#define configSUPPORT_DYNAMIC_ALLOCATION        1                       //Support for dynamic memory requests
#define configSUPPORT_STATIC_ALLOCATION 1 //Support static memory requests
#define configTOTAL_HEAP_SIZE ((size_t)(20*1024)) //System all heap size

[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] KingbaseES V8R3 Error: cluster.log ERROR: md5 authentication failed

Case description:

In the cluster of KingbaseES V8R3 cluster The error message “ERROR: md5 authentication failed; DETAIL: password does not match” often appears in the log. This case shows the cause of this error.

Applicable version:KingbaseES V8R3

Problem phenomenon:
cluster.log:

Analysis: 1, when the system user connects to port 9999 to execute “show pool_nodes”, you need to access the cluster kingbasecluster service and verify the user’s identity by cluster_password.

As shown below: cluster.log information

2. The password of the system user needs to be verified by the database sys_hba.conf (the password is encrypted by md5).

As shown below: cluster.log information

3. And port 9999 corresponds to the kingbasecluster service, which also needs to be verified by the md5 password in the cluster_password file.

4. If the database password and the password in cluster_password do not match, you cannot log in.

5. This error message does not affect the health detection of the background database by kingbasecluster.

Problem-solving:

When changing the database user system password in the cluster.
        1、Modify the password of the system user in the database.
        2, also need to modify the password of system user in cluster_password by sys_md5 tool. 
        3, you need to modify the password of system in the recovery.done and recovery.conf configuration files.