Hi all, I’m having trouble to import module in TD. I failed to solve it. Hope someone here could give some tips. Thank you very much in advance!
I have a virtual environment. Other modules like numpy, pandas work well in TD.
However when I tried simplet5 module, it failed.
I use pip install in my conda environment and it worked well outside of TD in jupyter notebook. I managed to import it and use it in jupyter notebook.
However in TD, it threw the error:
Traceback (most recent call last):
File “</project1/loadmodel:op(‘/project1/loadmodel’).run()>”, line 1
td.tdError: File “/project1/loadmodel”, line 1
r = previousimport(*args, **kw)
File “C:\Users/studio/anaconda3/envs/td-tfgpu/Lib/site-packages\simplet5_init_.py”, line 1
from .simplet5 import SimpleT5
r = previousimport(*args, **kw)
File “C:\Users/studio/anaconda3/envs/td-tfgpu/Lib/site-packages\simplet5\simplet5.py”, line 4
from transformers import (
r = previousimport(*args, **kw)
File “”, line 1055, in _handle_fromlist
File “C:\Users/studio/anaconda3/envs/td-tfgpu/Lib/site-packages\transformers\file_utils.py”, line 2694, in getattr
module = self._get_module(self._class_to_module[name])
File “C:\Users/studio/anaconda3/envs/td-tfgpu/Lib/site-packages\transformers\file_utils.py”, line 2704, in get_module
return importlib.import_module(“.” + module_name, self.name)
File "C:\Program Files\Derivative\TouchDesigner.2022.24200\bin\lib\importlib_init.py", line 127, in import_module
return bootstrap.gcd_import(name[level:], package, level)
File "C:\Users/studio/anaconda3/envs/td-tfgpu/Lib/site-packages\transformers\models_init.py", line 19
from . import (
r = previousimport(*args, **kw)
File "C:\Users/studio/anaconda3/envs/td-tfgpu/Lib/site-packages\transformers\models\layoutlm_init.py", line 22
from .configuration_layoutlm import LAYOUTLM_PRETRAINED_CONFIG_ARCHIVE_MAP, LayoutLMConfig
r = previousimport(*args, **kw)
File “C:\Users/studio/anaconda3/envs/td-tfgpu/Lib/site-packages\transformers\models\layoutlm\configuration_layoutlm.py”, line 19
from transformers import PretrainedConfig, PreTrainedTokenizer, TensorType
r = previousimport(*args, **kw)
File “”, line 1055, in _handle_fromlist
File “C:\Users/studio/anaconda3/envs/td-tfgpu/Lib/site-packages\transformers\file_utils.py”, line 2694, in getattr
module = self._get_module(self._class_to_module[name])
File “C:\Users/studio/anaconda3/envs/td-tfgpu/Lib/site-packages\transformers\file_utils.py”, line 2704, in get_module
return importlib.import_module(“.” + module_name, self.name)
File "C:\Program Files\Derivative\TouchDesigner.2022.24200\bin\lib\importlib_init.py", line 127, in import_module
return _bootstrap.gcd_import(name[level:], package, level)
File “C:\Users/studio/anaconda3/envs/td-tfgpu/Lib/site-packages\transformers\tokenization_utils.py”, line 27
from .tokenization_utils_base import (
r = previousimport(*args, **kw)
File “C:\Users/studio/anaconda3/envs/td-tfgpu/Lib/site-packages\transformers\tokenization_utils_base.py”, line 77
from tokenizers import AddedToken
r = previousimport(*args, **kw)
File "C:\Users/studio/anaconda3/envs/td-tfgpu/Lib/site-packages\tokenizers_init.py", line 79
from .tokenizers import (
r = previousimport(*args, **kw)
pyo3_runtime.PanicException: assertion failed: !handle.is_null()
Results of run operation resulted in exception.