-1

I'm using raspberry pi 4 and installed openvino to use the recognition feature. I ignored that the cv2 version is 4.2.0-openvino, because the dnn function cannot be used, so I upgraded opencv. After the upgrade, my original code did not execute. There are many errors, is there a solution?

This is the error code:

Traceback (most recent call last):
  File "/home/pi/Desktop/test3/FPS.py", line 1, in <module>
    import cv2
  File "/home/pi/.local/lib/python3.7/site-packages/cv2/__init__.py", line 181, in <module>
    bootstrap()
  File "/home/pi/.local/lib/python3.7/site-packages/cv2/__init__.py", line 111, in bootstrap
    load_first_config(['config.py'], True)
  File "/home/pi/.local/lib/python3.7/site-packages/cv2/__init__.py", line 106, in load_first_config
    exec_file_wrapper(fpath, g_vars, l_vars)
  File "/home/pi/.local/lib/python3.7/site-packages/cv2/load_config_py3.py", line 8, in exec_file_wrapper
    code = compile(f.read(), os.path.basename(fpath), 'exec')
ValueError: source code string cannot contain null bytes

Hope to get help from kind people

Markus
  • 5,976
  • 5
  • 6
  • 21
Mr.wang
  • 1
  • 1

1 Answers1

0

OpenCV is used as image processing library and OpenVINO is not linked with OpenCV. The error message indicates that the content of the file includes a byte that has a null value. The value of the argument passed is invalid. You may try one of the solutions below:

  1. Remove null character.
  2. Use sed command: sed -i 's/x0//g' FILENAME
  3. Use pipeline : python -c 'import sys; sys.stdout.write(sys.stdin.read(),replace("\0",""))'
Aznie_Intel
  • 101
  • 3