Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attribute Error while running test #42

Open
svmaskery opened this issue Jun 9, 2022 · 0 comments
Open

Attribute Error while running test #42

svmaskery opened this issue Jun 9, 2022 · 0 comments

Comments

@svmaskery
Copy link

svmaskery commented Jun 9, 2022

There is an issue while running the test phase with the given code according to the instructions provided. Train phase runs without any issues but test phase runs into error.
python train.py --phase test --dataset_path mvt_data --category capsule --project_root_path ./

Error:

File "train.py", line 442, in <module>
    trainer.test(model)
  File "/home/shreevijay/anaconda3/envs/patch_unoff/lib/python3.6/site-packages/pytorch_lightning/trainer/trainer.py", line 911, in test
    return self._call_and_handle_interrupt(self._test_impl, model, dataloaders, ckpt_path, verbose, datamodule)
  File "/home/shreevijay/anaconda3/envs/patch_unoff/lib/python3.6/site-packages/pytorch_lightning/trainer/trainer.py", line 685, in _call_and_handle_interrupt
    return trainer_fn(*args, **kwargs)
  File "/home/shreevijay/anaconda3/envs/patch_unoff/lib/python3.6/site-packages/pytorch_lightning/trainer/trainer.py", line 954, in _test_impl
    results = self._run(model, ckpt_path=self.tested_ckpt_path)
  File "/home/shreevijay/anaconda3/envs/patch_unoff/lib/python3.6/site-packages/pytorch_lightning/trainer/trainer.py", line 1199, in _run
    self._dispatch()
  File "/home/shreevijay/anaconda3/envs/patch_unoff/lib/python3.6/site-packages/pytorch_lightning/trainer/trainer.py", line 1275, in _dispatch
    self.training_type_plugin.start_evaluating(self)
  File "/home/shreevijay/anaconda3/envs/patch_unoff/lib/python3.6/site-packages/pytorch_lightning/plugins/training_type/training_type_plugin.py", line 206, in start_evaluating
    self._results = trainer.run_stage()
  File "/home/shreevijay/anaconda3/envs/patch_unoff/lib/python3.6/site-packages/pytorch_lightning/trainer/trainer.py", line 1286, in run_stage
    return self._run_evaluate()
  File "/home/shreevijay/anaconda3/envs/patch_unoff/lib/python3.6/site-packages/pytorch_lightning/trainer/trainer.py", line 1334, in _run_evaluate
    eval_loop_results = self._evaluation_loop.run()
  File "/home/shreevijay/anaconda3/envs/patch_unoff/lib/python3.6/site-packages/pytorch_lightning/loops/base.py", line 140, in run
    self.on_run_start(*args, **kwargs)
  File "/home/shreevijay/anaconda3/envs/patch_unoff/lib/python3.6/site-packages/pytorch_lightning/loops/dataloader/evaluation_loop.py", line 96, in on_run_start
    self._on_evaluation_start()
  File "/home/shreevijay/anaconda3/envs/patch_unoff/lib/python3.6/site-packages/pytorch_lightning/loops/dataloader/evaluation_loop.py", line 178, in _on_evaluation_start
    self.trainer.call_hook("on_test_start", *args, **kwargs)
  File "/home/shreevijay/anaconda3/envs/patch_unoff/lib/python3.6/site-packages/pytorch_lightning/trainer/trainer.py", line 1501, in call_hook
    output = model_fx(*args, **kwargs)
  File "train.py", line 329, in on_test_start
    self.index = faiss.read_index(os.path.join(self.embedding_dir_path,'index.faiss'))
  File "/home/shreevijay/anaconda3/envs/patch_unoff/lib/python3.6/site-packages/torch/nn/modules/module.py", line 948, in __getattr__
    type(self).__name__, name))
AttributeError: 'STPM' object has no attribute 'embedding_dir_path'`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant