img = cv2.resize(img, (512, 1024))
cv2.error: OpenCV(4.2.0) /io/opencv/modules/imgproc/src/resize. cpp:4045 : error: (-215:Assertion failed) ! ssize.empty() in function ‘resize’
The code can run normally in win10, but the above error is reported in Linux. My analysis is due to the different address reading formats between win10 and Linux.
img = cv2.imread(item['path'])
#item['path']:'./data/TuSimple/LaneDetection\clips/0313-2/42120/20.jpg'
There is a ‘\’ in the address of item [‘path ‘], which results in an error in Linux operation
so change the’ \ ‘in the address of item [‘path’] to ‘/’
item['path']=item['path'].replace('\\', '/')#Add this code
img = cv2.imread(item['path'])
Read More:
- [Solved] Ubuntu 18.04 Install opencv3.2.0 and opencv_contrib Error
- [Solved] Denseflow Install Error: fatal error: opencv2/cudaarithm.hpp: No such file or directory
- [Solved] Linux WebService Startup Error: BindException: Cannot assign requested address
- Ubuntu install and compile OpenCV3.4.0 fatal error: dynlink_nvcuvid.h: No such file or directory #include <dynlink_nv
- Linux: Configure Network address through Netplan
- Linux Error: bind error: Address already in use [How to Solve]
- Solution to gzip: stdin: invalid compressed data — format violated error in decompressing. Tgz file under Linux
- Win10 Start Linux error: Error: 0x800701bc WSL 2 [How to Solve]
- [Solved] Linux — 9 — txt files are copied from windows to Linux and read error
- [Solved] Linux Error: mipsel-linux-gcc: fatal error: no input files
- [Solved] Linux Error: Failed to start bean ‘webServerStartStop‘; nested exception is org.springframework.
- [Solved] Win 10 VS Code Connect to the container of the server error: Cannot connect to the Docker daemon at … Is the docker daemon running
- stream copy error: reading from a closed fifo [How to Solve]
- [Solved] Linux program error: dpkg is interrupted. You must manually run ‘sudo dpkg — configure – a’
- [Solved] Linux installation pillow error: ValueError: jpeg is required unless explicitly disabled using –disable-jpeg, aborting
- [Solved] Jenkins+Ant Error: Error reading project file xxxxx
- Nginx Error: [emerg] bind() to [::]:80 failed (98: Address already in use)
- [Solved] Linux Error: tar: Error Is Not Recoverable: Exiting Now
- [Solved] Linux error E: dpkg is broken, you must manually run ‘sudo dpkg –configure -a’ to resolve this issue
- How to set fixed IP address for Raspberry Pie