Suanmd / TR-MISR

47 stars 7 forks source link

ZeroDivisionError: float division by zero #2

Open Entretoize opened 2 years ago

Entretoize commented 2 years ago

When I run the train.py script with the probav_data i get this:

(py39) h:\git\TR-MISR>python ./src/train.py
loss:  -4.4875
loss:  -15.8379
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [02:56<00:00, 88.34s/it]
  0%|                                                                                                                                                                       | 0/400 [03:01<?, ?it/s]
Traceback (most recent call last):
  File "h:\git\TR-MISR\src\train.py", line 302, in <module>
    main(config)
  File "h:\git\TR-MISR\src\train.py", line 289, in main
    trainAndGetBestModel(fusion_model, optimizer, dataloaders, baseline_cpsnrs, config)
  File "h:\git\TR-MISR\src\train.py", line 173, in trainAndGetBestModel
    val_score /= len(dataloaders['val'].dataset)
ZeroDivisionError: float division by zero

Maybe because there's nothing in the split_data/val folder ?

nonick2k23 commented 1 year ago

len(dataloaders['val'].dataset) = 0

What do you think?

Entretoize commented 1 year ago

No dataset ? Nothing in the dataset ? Why ?

nonick2k23 commented 1 year ago

Did you download and prepare the dataset?

Did you follow this: https://github.com/Suanmd/TR-MISR#1-prepare-the-data-set

Are you sure the path is correct?

The dataset is there.

Entretoize commented 1 year ago

Ok, but what if I want to train my own dataset ?