scenic icon indicating copy to clipboard operation
scenic copied to clipboard

vid2seq: No module named 'scenic.projects.vid2seq.metrics'

Open aoken7 opened this issue 2 years ago • 3 comments

Hello.

I tried running the training example for vid2seq, but it fails with the error message ModuleNotFoundError: No module named 'scenic.projects.vid2seq.metrics'. I cannot locate the 'metrics' folder within the 'vid2seq' directory.

root@69f01d07357c:/workspace/scenic# python -m scenic.projects.vid2seq.main \
>   --config=scenic/projects/vid2seq/configs/youcook2.py \
>   --workdir=vid2seq_base/
2023-05-18 07:52:19.433056: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT
Traceback (most recent call last):
  File "/opt/conda/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/opt/conda/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/workspace/scenic/scenic/projects/vid2seq/main.py", line 13, in <module>
    from scenic.projects.vid2seq import trainer
  File "/workspace/scenic/scenic/projects/vid2seq/trainer.py", line 31, in <module>
    from scenic.projects.vid2seq import dvc_eval
  File "/workspace/scenic/scenic/projects/vid2seq/dvc_eval.py", line 14, in <module>
    from scenic.projects.vid2seq.metrics.cider import Cider
ModuleNotFoundError: No module named 'scenic.projects.vid2seq.metrics' 

Are there any possible solutions or workarounds for this issue?

aoken7 avatar May 18 '23 07:05 aoken7

hi, I think you should download this project: https://github.com/antoyang/captioning-metrics and rename it as metrics, put it into vid2seq folder. But I got stuck in t5 project. I only have GPU. Any suggestions?

 exec(code, run_globals)
  File "/data06/lp_data/scenic/scenic/projects/vid2seq/main.py", line 14, in <module>
    from scenic.projects.vid2seq.datasets.dense_video_captioning_tfrecord_dataset import get_datasets
  File "/data06/lp_data/scenic/scenic/projects/vid2seq/datasets/dense_video_captioning_tfrecord_dataset.py", line 14, in <module>
    from scenic.projects.vid2seq import data_utils as vid2seq_data_utils
  File "/data06/lp_data/scenic/scenic/projects/vid2seq/data_utils.py", line 10, in <module>
    from t5.data.preprocessors import DenoiseInputsFn
ModuleNotFoundError: No module named 't5'

Bensonlp avatar May 19 '23 06:05 Bensonlp

hi, I think you should download this project: https://github.com/antoyang/captioning-metrics and rename it as metrics, put it into vid2seq folder. But I got stuck in t5 project. I only have GPU. Any suggestions?

 exec(code, run_globals)
  File "/data06/lp_data/scenic/scenic/projects/vid2seq/main.py", line 14, in <module>
    from scenic.projects.vid2seq.datasets.dense_video_captioning_tfrecord_dataset import get_datasets
  File "/data06/lp_data/scenic/scenic/projects/vid2seq/datasets/dense_video_captioning_tfrecord_dataset.py", line 14, in <module>
    from scenic.projects.vid2seq import data_utils as vid2seq_data_utils
  File "/data06/lp_data/scenic/scenic/projects/vid2seq/data_utils.py", line 10, in <module>
    from t5.data.preprocessors import DenoiseInputsFn
ModuleNotFoundError: No module named 't5'

This is because the scenic/projects/t5 folder lacks the init.py file, the package can't find it. I'll submit a pr for that. But you can add that init.py yourself.

LumenYoung avatar May 31 '23 09:05 LumenYoung

@LumenYoung Thanks for replying and also offering help by sending PR. init.py files are added automatically when being exported to GitHub. I have to fix change some configuration to fix this, I'll take care of this internally. Hope don't mind.

MostafaDehghani avatar May 31 '23 10:05 MostafaDehghani