question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Why can't the renamed "triton_python_backend_utils.py" and other modules be imported in models directory?

See original GitHub issue

Hello

this worked fine from your example :

11

but when i renamed the triton_python_backend_utils.py file to :

11

in model.py import utility as pb_utils

got an error :

ModuleNotFoundError: No module named 'utility'

this also happens when i want to import my own modules , for example here

11

i get

ModuleNotFoundError: No module named 'process_1'

I note that i just copied those files directly into docker volume and left python_backend_main folder out of it :

docker run --gpus=all --shm-size=1g --ulimit memlock=-1 -p 8000:8000 -p 8001:8001 -p 8002:8002 -v $PWD/models:/models --ulimit stack=67108864 -ti tritonserver:20.10-py3

# tritonserver --model-repository /models

where i used dockerfile :

FROM nvcr.io/nvidia/tritonserver:20.10-py3

RUN pip3 install  --upgrade  --no-cache-dir  \
    torchvision

So where else should i put those new modules ?

Another issue , what should i do if my pytorch script additionally loads pre-trained *.pt file ? here is the case :

11

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Tabriziancommented, Feb 19, 2021

The fix is not available in the 20.11 release. It has been fixed in the 20.12 release.

0reactions
virgile-blgcommented, Feb 19, 2021

Hi @Tabrizian ,

In which version this bug has been fixed ? I am running triton version 2.5.0 from container 20.11 and i am still struggling importing custom python modules from model.py As I am deploying Triton on GKE I cannot upgrade Triton to the very latest version.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Python error "ImportError: No module named" - Stack Overflow
If the extension is different such as in my case .py.bin then Python cannot move through the directories and then it cannot find...
Read more >
5. The import system — Python 3.11.1 documentation
Python code in one module gains access to the code in another module by the process of importing it. The import statement is...
Read more >
JavaScript modules - MDN Web Docs
This guide gives you all you need to get started with JavaScript module syntax.
Read more >
Python - Import from parent directory - GeeksforGeeks
From Python 3.3, referencing or importing a module in the parent ... file named temp.py, Now let's try if we can import the...
Read more >
ModuleNotFoundError: No module named x
tl;dr. Use absolute imports; Append your project's root directory to PYTHONPATH — In any environment you wish to run your Python application ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found