-
Notifications
You must be signed in to change notification settings - Fork 76
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
ZeroDivisionError while running train.py #7
Comments
@TuhinKundu The error happened during the validation process and it looks like that the length of the validation dataset is zero! Make sure your validation set is copied under |
@knazeri Thanks for responding! But I am definitely putting in a validation set comprising of 100 random images from the train set. Is the nomenclature of the validation set images to be maintained/changed to resolve the problem (as it may not be read by the program)? Because I did not change the names of the images while copying from the train set. My validation set is currently like this: |
@TuhinKundu Your validation set is fine, I guess the root of this problem might be this line: Line 21 in 1655c23
We are using glob to load files from a local disk, I'm not exactly sure if that's the right way to load data on Google Colab. You can check this by printing the size of the data to the output: print(len(labels))
|
Have setup the repository on Google Colab and uploaded train, test and validation (of 100 random images from train set) and tried running train.py which resulted in the following error. Any help?
------------ Options -------------
batch_size: 64
beta1: 0.9
beta2: 0.999
channels: 1
checkpoints_path: ./checkpoints
cuda: True
dataset_path: ./dataset
debug: False
ensemble: 1
epochs: 30
gpu_ids: 0
log_interval: 50
lr: 0.001
network: 0
no_cuda: False
patch_stride: 256
seed: 1
test_batch_size: 64
testset_path:
-------------- End ----------------
Loading "patch-wise" model...
Start training patch-wise network: 2018/12/28 16:59
/content/ICIAR2018/src/datasets.py:28: RuntimeWarning: invalid value encountered in long_scalars
self.augment_size = np.prod(self.shape) / len(labels)
Traceback (most recent call last):
File "train.py", line 14, in
pw_model.train()
File "/content/ICIAR2018/src/models.py", line 56, in train
best = self.validate(verbose=False)
File "/content/ICIAR2018/src/models.py", line 151, in validate
test_loss /= len(test_loader.dataset)
ZeroDivisionError: division by zero
The text was updated successfully, but these errors were encountered: