zhanghang1989 / zhanghang1989/PyTorch-Encoding

Import Error: cannot import name 'Module'

Open
#204 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
2k
Forks
448
PR merge metrics
No merged PRs in 30d

Description

In my case I try to run the den-texture encoding network
My environment is : on the computer is cuda 10 without cudnn

packages in environment at /home/myhuang/anaconda3/envs/den:

Name Version Build Channel

blas 1.0 mkl
ca-certificates 2019.1.23 0
certifi 2019.3.9 py36_0
cffi 1.12.3 py36h2e261b9_0
chardet 3.0.4 pypi_0 pypi
cudatoolkit 10.0.130 0
cudnn 7.6.0 cuda10.0_0
freetype 2.9.1 h8a8886c_1
idna 2.8 pypi_0 pypi
intel-openmp 2019.3 199
jpeg 9b h024ee3a_2
libedit 3.1.20181209 hc058e9b_0
libffi 3.2.1 hd88cf55_4
libgcc-ng 8.2.0 hdf63c60_1
libgfortran-ng 7.3.0 hdf63c60_0
libpng 1.6.37 hbc83047_0
libstdcxx-ng 8.2.0 hdf63c60_1
libtiff 4.0.10 h2733197_2
mkl 2019.3 199
mkl_fft 1.0.12 py36ha843d7b_0
mkl_random 1.0.2 py36hd81dba3_0
ncurses 6.1 he6710b0_1
ninja 1.9.0 py36hfd86e86_0
nose 1.3.7 pypi_0 pypi
numpy 1.16.4 py36h7e9f1db_0
numpy-base 1.16.4 py36hde5b4d6_0
olefile 0.46 py36_0
openssl 1.0.2s h7b6447c_0
pillow 6.0.0 py36h34e0f95_0
pip 19.1.1 py36_0
pycparser 2.19 py36_0
python 3.6.5 hc3d631a_2
pytorch 1.0.1 py3.6_cuda10.0.130_cudnn7.4.2_2 pytorch
readline 7.0 h7b6447c_5
requests 2.22.0 pypi_0 pypi
scipy 1.3.0 pypi_0 pypi
setuptools 41.0.1 py36_0
six 1.12.0 py36_0
sqlite 3.28.0 h7b6447c_0
tk 8.6.8 hbc83047_0
torch-encoding 1.0.1 pypi_0 pypi
torchvision 0.2.2 py_3 pytorch
tqdm 4.32.1 pypi_0 pypi
urllib3 1.25.3 pypi_0 pypi
wheel 0.33.4 py36_0
xz 5.2.4 h14c3975_4
zlib 1.2.11 h7b6447c_3
zstd 1.3.7 h0b5b093_0

and after python setup.py install then run the python prepare_minc.py it said

python scripts/prepare_minc.py
Traceback (most recent call last):
File "scripts/prepare_minc.py", line 5, in
from encoding.utils import download, mkdir
File "/home/myhuang/anaconda3/envs/den/lib/python3.6/site-packages/encoding/init.py", line 13, in
from . import nn, functions, parallel, utils, models, datasets, transforms
File "/home/myhuang/anaconda3/envs/den/lib/python3.6/site-packages/encoding/nn/init.py", line 12, in
from .encoding import *
File "/home/myhuang/anaconda3/envs/den/lib/python3.6/site-packages/encoding/nn/encoding.py", line 13, in
from torch.nn import Module, Parameter
ImportError: cannot import name 'Module'

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running scripts/prepare_minc.py in the reported Python environment and read encoding/nn/encoding.py, especially its torch.nn import. Trace the installed encoding package and PyTorch versions; the issue is done when prepare_minc.py starts without the reported ImportError.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
machine-learning
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.