Git Product home page Git Product logo

Comments (7)

stefanopini avatar stefanopini commented on May 18, 2024 1

Dear @timtensor , I've finally been able to reproduce the error and fix it. It was related to different sys.path initialization between anaconda and non-anaconda environments.
Thank you for sharing your code. Indeed, my workaround is similar to yours, but it works regardless of the path of the project.

Regarding CUDA, you just need to install pytorch with CUDA support. If the script outputs cuda:0, it means that the GPU 0 (with CUDA support) is used to execute the network.
If you need further support, please open a specific issue (e.g. "frame rate is very low").

from simple-hrnet.

stefanopini avatar stefanopini commented on May 18, 2024

Hi! To import the simpleHRNet module, you need to have the project root path (i.e. the directory with the file SimpleHRNet.py) in your "python path" (i.e. the path in which python search the packages).
By default, the working directory is automatically added to your "python path" so it should work if you run the script from the project root with the command python scripts/live-demo.py .

On Linux, you can check it running the command python -c "import sys;print(sys.path)": you should find your working directory in the printed list. (On Windows, the working directory is represented with an empty string.)
If you don't find it, just add the project root path to the environment variable PYTHONPATH.

from simple-hrnet.

timtensor avatar timtensor commented on May 18, 2024

Hi @stefanopini ,Ok i think i understand you . I did a print out of the system configuration which i do have the root folder
['', '/home/pm/pf/simple-HRNet/datasets', '/home/pm/pf/simple-HRNet/misc', '/home/pm/pf/simple-HRNet/models', '/home/pm/pf/simple-HRNet/__pycache__', '/home/pm/pf/simple-HRNet/scripts', '/home/pm/pf/simple-HRNet/test', '/home/pm/pf/simple-HRNet/weights', '/home/pm', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-x86_64-linux-gnu', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/home/pm/.local/lib/python2.7/site-packages', '/usr/local/lib/python2.7/dist-packages', '/usr/local/lib/python2.7/dist-packages/pyOpenSSL-19.0.0-py2.7.egg', '/usr/lib/python2.7/dist-packages']

However i have two versions of python ,python3.5andpython2.7` . Do you think it interferes ??

from simple-hrnet.

stefanopini avatar stefanopini commented on May 18, 2024

Yes, it could because I didn't test the script on python 2.7... You should use python 3.
Can you try to run the software using python3 scripts/live-demo.py?
In any case, I suggest you to use a virtual environment (see https://docs.python.org/3.7/tutorial/venv.html).

from simple-hrnet.

timtensor avatar timtensor commented on May 18, 2024

Hi @stefanopini , as you suggested i created a virtua enviroment . I see an error from the yolo model and running on python3.6
The error is as follows
Traceback (most recent call last):

  File "<stdin>", line 1, in <module>
  File "/home/test/simple-HRNet/SimpleHRNet.py", line 6, in <module>
    from models.detectors.YOLOv3 import YOLOv3
  File "/home/test/simple-HRNet/models/detectors/YOLOv3.py", line 7, in <module>
    from .yolo.models import Darknet
  File "/home/test/simple-HRNet/models/detectors/yolo/models.py", line 9, in <module>
    from utils.parse_config import *
ModuleNotFoundError: No module named 'utils'

The above error seems to be of yolo module , so i am not sure what is the problem
the output of the sys path is as follows

'/home/test/simple-HRNet', '/usr/lib/python36.zip', '/usr/lib/python3.6', '/usr/lib/python3.6/lib-dynload', '/home/test/simple-HRNet/simpleHrnet/lib/python3.6/site-packages']

from simple-hrnet.

stefanopini avatar stefanopini commented on May 18, 2024

You're right, there was a bug on the yolo import... I should have just fixed it.
Let me know if it works now.

from simple-hrnet.

timtensor avatar timtensor commented on May 18, 2024

@stefanopini finally i managed to run the script but modying the sys path in the file ``/live-demo.py ` .

import sys 
sys.path.append("/home/test/simple-HRNet")

Maybe it is a dirty solution but seems to work .
and running the following , I still need to specify the --weights flag . However , when i run it , in a CUDA enabled device , i still get CUDA 0 and was wondering how can i get the venv access the CUDA. Do i have to install the CUDA toolkit for the venv ?? And did you have some ideas as in how to optimzie the detections ??
We get the following printout of torch.cuda.is_available()
True cuda:0
Does it mean it is accesing the CUDA drivers ? the output frame rate seems to very slow .

from simple-hrnet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.