the-full-stack / fsdl-text-recognizer-2021-labs

Complete deep learning project developed in Full Stack Deep Learning, Spring 2021
https://bit.ly/berkeleyfsdl
MIT License
452 stars 281 forks source link

Lab 7: AttributeError: 'IAMParagraphs' object has no attribute 'data_test' #36

Open InHouse-Banana opened 3 years ago

InHouse-Banana commented 3 years ago

When running Lab 7

PYTHONPATH=. python training/run_experiment.py --wandb --gpus=-1 --data_class=IAMOriginalAndSyntheticParagraphs --model_class=ResnetTransformer --loss=transformer --batch_size=16 --check_val_every_n_epoch=10 --terminate_on_nan=1 --num_workers=32 --accelerator=ddp --lr=0.001 --accumulate_grad_batches=4 --max_epoch 1

I get the following error:

  File "/home/ubuntu/pytorch-lab/lab7_eds/text_recognizer/data/iam_original_and_synthetic_paragraphs.py", line 39, in setup
    self.data_test = self.iam_paragraphs.data_test
AttributeError: 'IAMParagraphs' object has no attribute 'data_test'

has anyone else seen it?

Roger-Li commented 2 years ago

Have you been able to follow along this lab? I tried to change this line into the following:

if stage == 'test' or stage is None:
    self.data_test = self.iam_paragraphs.data_test
InHouse-Banana commented 2 years ago

Have you been able to follow along this lab?... I think that I did, but I think that I didn't run with the option --data_class=IAMOriginalAndSyntheticParagraphs... what I can't really remember as it was a while ago.

Although I haven't tried your fix, I was thinking a fix along those lines when I encountered the error. Sadly, I never got around to a working solution. Hence, if it worked for you, I guess that it would for me as well. Hence, why don't you PR it?~

Thank you!