scenic
scenic copied to clipboard
ModuleNotFoundError: No module named 'scenic.projects.token_learner'
Hi, why this error occurs when trying to run the code with the command blow
"
python scenic/projects/token_learner/main.py --
--config=scenic/projects/token_learner/configs/im1k_token_learner_config.py
--workdir=token_learner/
"
@F-Yuan303 I think that this is due to relative imports.
I think a __init__.py
is missing and I look at it later, but feel free to send a PR if you have a fix.
I think a
__init__.py
is missing and I look at it later, but feel free to send a PR if you have a fix.
Both vivit and token_learner can't be found when imort them.
I added blank __init__.py
files under token_lerarner and vivit with reference to other folders, but still reported an error.
Hello everyone, I was getting a similar issue when I tried to run the example included in the README file:
$ python scenic/main.py -- \
--config=scenic/projects/baselines/configs/imagenet/imagenet_vit_config.py \
--workdir=./
Traceback (most recent call last):
File "/zfs1/home/userenv/Scenic/scenic-main/scenic/main.py", line 27, in <module>
from scenic.train_lib import trainers
File "/home/userenv/.conda/envs/scenic/lib/python3.9/site-packages/scenic/train_lib/trainers.py", line 18, in <module>
from scenic.train_lib.transfer import transfer_trainer
ModuleNotFoundError: No module named 'scenic.train_lib.transfer'
It seems that I fixed it just by adding a blank __init__.py
to both scenic\train_lib\transfer
and scenic\train_lib\transfer\tests
folders, and redoing the installation with pip install .
I had the same problem,you can try insert: " import os, sys sys.path.append(os.getcwd())" before "from scenic import XXX" in "main.py".