niluthpol/multimodal_vtt

AttributeError: 'module' object has no attribute 'Vocabulary'

Closed this issue · 1 comments

mwray commented

Hi, I'm trying to use your code, however, when I run test_weighted.py I get the following error:

Traceback (most recent call last):
  File "test_weighted.py", line 10, in <module>
    evaluation.evalrank(RUN_PATH+"msrvtt_object_text/model_best.pth.tar", RUN_PATH+"msrvtt_activity_text/model_best.pth.tar", data_path=DATA_PATH, split="test", shared_space="both")
  File "/jmain01/home/JAD026/dxd01/mxw99-dxd01/workspace/multimodal_vtt/evaluation.py", line 137, in evalrank
    opt.vocab_path, 'vocab.pkl'), 'rb'))
  File "/jmain01/home/JAD026/dxd01/shared/miniconda3/envs/multimodal_vtt/lib/python2.7/pickle.py", line 1384, in load
    return Unpickler(file).load()
  File "/jmain01/home/JAD026/dxd01/shared/miniconda3/envs/multimodal_vtt/lib/python2.7/pickle.py", line 864, in load
    dispatch[key](self)
  File "/jmain01/home/JAD026/dxd01/shared/miniconda3/envs/multimodal_vtt/lib/python2.7/pickle.py", line 1096, in load_global
    klass = self.find_class(module, name)
  File "/jmain01/home/JAD026/dxd01/shared/miniconda3/envs/multimodal_vtt/lib/python2.7/pickle.py", line 1132, in find_class
    klass = getattr(mod, name)
AttributeError: 'module' object has no attribute 'Vocabulary'

I believe this is due to it trying to load in the vocab.pkl. I have tried opening the pickle manually and it gives the same error. Any help would be appreciated.

Hi Wray,
Thanks a lot for your interest in our work. I have added vocab.py in vocab directory. This should solve the issue.