I have problems with import and i need help.
First of all, i couldnt import torch2trt and trt_pose after installation.I copied these folders into the folder Jupiter0 (my folder for program execution in the docker container) and as a result i could import them.
But there is a lot of other dependencies and i just cant copy all of them, because i have the same problem on the each level of the folder.Container can import programm only directly from the Jupiter0 folder and cant import programm from the folder which is located in the Jupiter0 folder.
How can i import all dependencies from torch2trt and trt_pose into the docker container ?
Hi @A98, it’s hard to dissect from your screenshots, but when you install these packages in the container, clone them to a different folder than your project exists in. And do not have your file called torch2trt.py because that is the name of another module.
I think what’s happening is that you have a file called torch2trt.py and also a folder of that, and when you try import torch2trt it is calling those local files instead of the ones that got installed under /usr/local/lib/python3.6
import will look for files/directories under your local CWD before searching the installed packages for them.
Also, just FYI, jetson-inference already includes the pose estimation models from trt_pose (used by jetson_inference.poseNet)
Hi.Thanks for your reply.I cant get how to clone the folders to a different folder than my project exists in, becuase ,in my point of view, i dont have any other folders.
To execute programm in the docker conatiner i do these steps:
2.docker/run.sh --volume /my/host/path:/my/container/path (/my/host/path is atlas/desktop/Jupiter0)
As a result, i can execute (or import) programms, only if they are located directly in the Jupiter0 folder (and cant execute (or import) programms if they are located in the folder which is located in the Jupiter0 folder.Unfortunatelly i couldnt solve this problem by changing the matching names of the folders and programms).
As i said before, In my point of view i dont have any other folders,so :
Should i create 1 more folder by the command :docker/run.sh --volume /my/host/path:/my/container/path , and clone my packages in it ?(In my point of view problem will be the same in this situation. For some reason docker container cant import packages from the folder, which is located in the /my/host/path and can import packages only directly from it)
Or maybe i should clone these packages in the jetson-inference folder?
Or maybe another folder ?If so, could you give me the path to it ?
@A98 you should clone the packages into a different folder inside the container, like /opt, and install them from there. It needn’t be mounted. After they are installed, you can save the changes to the container with docker commit or by making your own Dockerfile that uses jetson-inference as a base.
Hi @A98, clone the packages inside the container once it’s running - the container has a different filesystem, and you want to install them inside the container.
Once you run docker/run.sh the prompt will change to # and those commands are run in the container. Then clone the other libraries you want to a directory different from your project’s so you don’t get the namespace collisions that you were with import (and try not naming your python files the same as another module is called)
@A98, based on your new topics, it would seem that you are not installing these packages in the container itself, rather just copying the directories from your host into the container. You need to run pip/setup.py/ect to install the packages in the running container (or create/build your own Dockerfile). None of this process is specific to Jetson and there are many Docker tutorials out there that you can familiarize yourself with first before doing more complex things with them.