ModuleNotFoundError: No module named 'torch.backends' - python-3.x

I would like to run the yolov5 source code for object detection on visual studio, but every time I run it, I get the following error. I tried to post the full code here but it kept giving me an error. Anyone who can help?
PS C:\Users\ALLO CEDRIC BOLAMBA\Desktop\Project> & "C:/Users/ALLO CEDRIC BOLAMBA/AppData/Local/Microsoft/WindowsApps/python3.10.exe" "c:/Users/ALLO CEDRIC BOLAMBA/Desktop/Project/detect.py"
Traceback (most recent call last):
File "c:\Users\ALLO CEDRIC BOLAMBA\Desktop\Project\detect.py", line 8, in <module>
import torch.backends.cudnn as cudnn
ModuleNotFoundError: No module named 'torch.backends'
PS C:\Users\ALLO CEDRIC BOLAMBA\Desktop\Project>

Related

I was able to run ros by "roscore" . But now I am getting an error

I was able to run ros by "roscore" earlier. But now I am getting an error:
Traceback (most recent call last):
File "/usr/bin/roscore", line 36, in <module>
from rosmaster.master_api import NUM_WORKERS
ModuleNotFoundError: No module named 'rosmaster'
How to fix the issue?
This error is caused from not sourcing the setup file. Every time you open a new terminal make sure you run source /opt/ros/$ROS_DISTRO/setup.bash or make sure that command is added to your ~/.bashrc file

Installed script with tkinter module returns error

I tried to convert my tkinter.py script to the tkinter.exe file. I used PyInstaller and I am sure the command was right, so no questions about PyInstaller. When conversion had completed I tried to execute but get the error:
Traceback (most recent call last):
File "Lib\site-packages\PyInstaller\hooks\rthooks\pyi_rth__tkinter.py", line 25, in <module>
FileNotFoundError: Tcl data directory "C:\Users\sashk\AppData\Local\Temp\_MEI42002\tcl" not found.
This error is related to tkinter module exactly and I can't find any solutions on the Web, please help.
I've renamed to Demo.py and it's started to work.

ModuleNotFoundError: No module named 'dnf'

When I point my python3 bin to /usr/bin/python3.6 I get below error:
[dgaikwad#localhost iqe-core]$ dnf
Traceback (most recent call last):
File "/usr/bin/dnf", line 57, in <module>
from dnf.cli import main
ModuleNotFoundError: No module named 'dnf'
[dgaikwad#localhost iqe-core]$
It is works fine when python3 pointed to /usr/bin/python3.7
Can someone please help me to solve it?

Python cv2 throws strange symbol error when importing

typically I can find the solution to any errors I have online, but I just cannot find the solution to this particular problem anywhere.
So I've installed OpenCV4 on my ubuntu 20.04 using pip3, but upon typing the following commands:
$ python3
import cv2
I get this error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/jordan/.local/lib/python3.7/site-packages/cv2/__init__.py", line 5, in <module>
from .cv2 import *
ImportError: /usr/lib/x86_64-linux-gnu/librsvg-2.so.2: undefined symbol: cairo_tag_end
I am not entirely sure what the error means. My guess is that it's something to do with the environment variables, but I don't know how to fix that anyways. I really hope someone can help me fix this.

ImportError: No module named darkflow.cli

I just want to do live object recognition from web-came using YOLO and while testing it, I am facing some issues. I am using Ubuntu os. Here is the error I get in terminal.
rajan#RGR:~/yolo setup/YOLO_Object_Detection-master$ ./flow --model cfg/yolo-new.cfg --load bin/yolo-new.weights --demo videofile.avi
Traceback (most recent call last):
File "./flow", line 4, in <module>
from darkflow.cli import cliHandler
ImportError: No module named darkflow.cli
Here is the link of the git repository which I am using as refenrece:
https://github.com/llSourcell/YOLO_Object_Detection

Resources