assert runtime is not None in example.py
LonglongaaaGo opened this issue · 5 comments
Hi @lmxyy ,
Thank you so much for your awesome work!
It is a very interesting topic, and I tried to run the example.py.
However, It was not successful. Could you help give me some advice?
Traceback (most recent call last):
File "/xx/sige-main/example.py", line 98, in
main()
File "/xx/sige-main/example.py", line 87, in main
sige_output = model(edited_input)
File "/xx/anaconda2/envs/pt1.7/lib/python3.7/site-packages/torch/nn/modules/module.py", line 889, in _call_impl
result = self.forward(*input, **kwargs)
File "/xx/sige-main/example.py", line 47, in forward
return self.example_module(x)
File "/xx/anaconda2/envs/pt1.7/lib/python3.7/site-packages/torch/nn/modules/module.py", line 889, in _call_impl
result = self.forward(*input, **kwargs)
File "/xx/sige-main/example.py", line 33, in forward
x = self.gather(x)
File "/xx/anaconda2/envs/pt1.7/lib/python3.7/site-packages/torch/nn/modules/module.py", line 889, in _call_impl
result = self.forward(*input, **kwargs)
File "/xx/sige-main/sige/nn/gather.py", line 79, in forward
assert runtime is not None
AssertionError
Thanks!
Hi, could you provide which system and device you are using so that I can figure out what is happening? Also, you could try the example in Colab first. This should work.
Hi @lmxyy ,
Thanks!
Yes, the Colab runs well.
I run on a PC with 2.90 GHz Intel R CoreTM i7-10700F CPU, 16 GB memory, NVIDIA GeForce RTX 2080 GPU.
The Pytorch version is 1.8
Thank you!
Hi @lmxyy ,
Thank you so much!
I tried and install the siga pip package.
The interactive session results are shown below:
Python 3.7.10 (default, Feb 26 2021, 18:47:35)
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
import sige.cpu
sige.cpu.gather
<built-in method gather of PyCapsule object at 0x7fbd56352b10>
import sige.cuda
sige.cuda.gather
<built-in method gather of PyCapsule object at 0x7fbd54eda3f0>
However, I tried to run the example.py again and encountered the same error.
Thank you!
This looks weird as you could import the package. Could you hack the package source code in sige/nn/base.py
like this:
for device in self.devices:
name = "sige.%s" % device
try:
module = importlib.import_module(name)
runtime = getattr(module, function_name)
runtime_dict[device] = runtime
except (ModuleNotFoundError, AttributeError) as err:
runtime_dict[device] = None
print('!!!name: %s device: %s' % (name, device))
print('@@@Error message: %s' % err)
I would like to know what caused your import fail.