Open jingong opened 5 years ago
I've run this code "python setup.py install", but I still can't import it.
@MarsTT, you will have to check the paths for the import_class function within torchlight. I think that import_class is in torchlight/io.py. https://github.com/limaosen0/AS-GCN/blob/ab6951c3e6fc1b22bb4a0dc87a33cca228aa69fe/torchlight/torchlight/io.py#L181. So, you may need to change the line to
from torchlight.io import import_class
You can repeat these steps for the other functions in the code.
我也有同样的问题 请问您解决了吗
I've run this code "python setup.py install", but I still can't import it.
Have you solved it?
@dangao250 You can follow the steps outlined by me. It worked.
You can follow the steps outlined by me. It worked.
I did what you did, but I still made a mistake
1) In torchlight directory, you will another torchlight directory which has 3 files:
Copy these to the outer torchlight directory like below
2) In all your files, you have to make changes in the torchlight import code.
from torchlight.io import import_class
should be the correct code.
For example, in processor/io.py file, the import line changes to:
It is present in the Torchlight folder. Have you built torchlight from setup.py? If yes, then, you may need to change the relative import here:
from torchlight import import_class
How to solve this error?
In torchlight directory, you will another torchlight directory which has 3 files:
gpu.py
init.py
io.py.
Copy these to the outer torchlight directory like below
- In all your files, you have to make changes in the torchlight import code.
from torchlight.io import import_class
should be the correct code.
For example, in processor/io.py file, the import line changes to:
How can you solve this problem?
How do you solve this problem?
In torchlight directory, you will another torchlight directory which has 3 files:
gpu.py
init.py
io.py.
Copy these to the outer torchlight directory like below
- In all your files, you have to make changes in the torchlight import code.
from torchlight.io import import_class
should be the correct code.
For example, in processor/io.py file, the import line changes to:
How do you solve this problem?
How do you solve this problem?
There is no IO class in torchlight. It is present in io.py file in torchlight folder. For this and other similar issues, you will have to read the 3 files present in the torchlight folder.
I replaced the torchlight/torchlight/ Init.py file here with theInit.py file under the stgcn project, and then ran setup.py again. This works.
I replaced the torchlight/torchlight/ Init.py file here with theInit.py file under the stgcn project, and then ran setup.py again. This works.
Did you change from torchlight. import import_class to from torchlight.io import import_class? I did what you said but got an error: ModuleNotFoundError: No module named 'processor.demo'
@ywang0218 You can comment the line processor.demo
Surprising! It worked. Thank you very much!
Surprising! It worked. Thank you very much!
Hello, may I ask you is how to solve ‘ImportError: can not import name 'import_class'’.
Hi,it's so easy.You can use this sentence 'from torchlight.io import_class' instead of the original sentence. Because the function of 'import_class' is in the io.py rather than the file of torchlight.I hope my answer can help you.
------------------ 原始邮件 ------------------ 发件人: "limaosen0/AS-GCN" <notifications@github.com>; 发送时间: 2020年8月10日(星期一) 中午12:01 收件人: "limaosen0/AS-GCN"<AS-GCN@noreply.github.com>; 抄送: "苦海两颗糖"<2296384501@qq.com>;"Comment"<comment@noreply.github.com>; 主题: Re: [limaosen0/AS-GCN] import_class not found (#4)
Surprising! It worked. Thank you very much!
Hello, may I ask you is how to solve ‘ImportError: can not import name 'import_class'’.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.
OK,thanks.发自我的华为手机-------- 原始邮件 --------发件人: Thomas_y notifications@github.com日期: 2020年8月10日周一 下午2:24收件人: limaosen0/AS-GCN AS-GCN@noreply.github.com抄送: Xiaoyuan Zhang 306835421@qq.com, Comment comment@noreply.github.com主 题: Re: [limaosen0/AS-GCN] import_class not found (#4)
Hi,it's so easy.You can use this sentence 'from torchlight.io import_class' instead of the original sentence. Because the function of 'import_class' is in the io.py
rather than the file of torchlight.I hope my answer can help you.
------------------ 原始邮件 ------------------
发件人: "limaosen0/AS-GCN" <notifications@github.com>;
发送时间: 2020年8月10日(星期一) 中午12:01
收件人: "limaosen0/AS-GCN"<AS-GCN@noreply.github.com>;
抄送: "苦海两颗糖"<2296384501@qq.com>;"Comment"<comment@noreply.github.com>;
主题: Re: [limaosen0/AS-GCN] import_class not found (#4)
Surprising! It worked. Thank you very much!
Hello, may I ask you is how to solve ‘ImportError: can not import name 'import_class'’.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.
—You are receiving this because you commented.Reply to this email directly, view it on GitHub, or unsubscribe.
I've run this code "python setup.py install", but I still can't import it.
you need to add the outer torchlight folder to the system path, just run the code below:
import sys sys.path.insert(0, '/content/drive/MyDrive/ST-GCN/torchlight')
that will solve this problem but it probably add the isue of no mudule name torchlight in processor.process.py which you need to modify this file and add
import torchlight.torchlight as torchlight instead of import torchlight
It is present in the Torchlight folder. Have you built torchlight from setup.py? If yes, then, you may need to change the relative import here: