zhanghang1989 / zhanghang1989/PyTorch-Encoding

encoding包安装成功后,引用报错

Open
#358 14 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

Using /home/user/anaconda3/lib/python3.7/site-packages
Finished processing dependencies for torch-encoding==1.2.2b20201225
您好,我在安装torch-encoding成功之后,import encoding的时候报错:

Traceback (most recent call last):
File "", line 1, in
File "/home/user/PyTorch-Encoding/encoding/init.py", line 13, in
from . import nn, functions, parallel, utils, models, datasets, transforms
File "/home/user/PyTorch-Encoding/encoding/nn/init.py", line 12, in
from .encoding import *
File "/home/user/PyTorch-Encoding/encoding/nn/encoding.py", line 18, in
from ..functions import scaled_l2, aggregate, pairwise_cosine
File "/home/user/PyTorch-Encoding/encoding/functions/init.py", line 2, in
from .encoding import *
File "/home/user/PyTorch-Encoding/encoding/functions/encoding.py", line 15, in
from encoding import cpu
ImportError: cannot import name 'cpu' from 'encoding' (/home/user/PyTorch-Encoding/encoding/init.py)

卸载重装之后还是这样报错,请问该如何解决?

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

Reproduce the reported failure with Python 3.7 by running import encoding after installing torch-encoding. Start with encoding/__init__.py, then inspect encoding/functions/encoding.py, where the failing cpu import is shown. Done means the package installs and import encoding completes without 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
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.