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.

No module named 'torch2trt.module_test'

See original GitHub issue

import torch2trt works fine, but from torch2trt import torch2trt would raise an error:

torch2trt/torch2trt/converters/activation.py in <module>()
      1 from torch2trt.torch2trt import *
----> 2 from torch2trt.module_test import add_module_test
      3 from .unary import UnaryModule
      4 
      5 
ModuleNotFoundError: No module named 'torch2trt.module_test'

Since import torch2trt just works, I also tried torch2trt.torch2trt(...) instead of torch2trt(...), but it still raises an error: AttributeError: module 'torch2trt' has no attribute 'torch2trt'.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5

github_iconTop GitHub Comments

2reactions
sebastian-szcommented, Jul 1, 2020

To install the torch2trt you can run python setup.py install after cloning the repo. After that you should be able to from torch2trt import torch2trt

0reactions
zifuwangggcommented, Mar 20, 2021

I had the above issue when I used some un-verified commit (I forgot which one). I think the problem is already solved.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Python3 ModuleNotFoundError: No module named 'torch2trt ...
Through a terminal opening python3,i can do the following - HOORAY! import torch2trt print(torch2trt.__file__) /home/user/torch2trt/torch2trt/__ ...
Read more >
Error running setup on torch2trt - Jetson Nano
I am trying to install the torch2trt python module. I ha… ... ImportError: No module named torch. I am new to this environment...
Read more >
Contributing - torch2trt
Contributing. Forms of contribution. Submit an Issue. torch2trt is use case driven. We originally created it to solve use cases related to NVIDIA...
Read more >
Python ModuleNotFoundError: No Module Named 'torch'
Quick Fix: Python raises the ImportError: No module named 'torch' when it cannot find the library torch . The most frequent source of...
Read more >
Simple index - piwheels
... hhx-message bot-exts package-name-abcd frozenpy newrelation gnota aqualink-api nhaystack wutong-search web3-constant haruka-bot anshu-python-calculator ...
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