After upgrading from 0.8.1 to 0.8.2, error occurs during training when the data is being transferred to the device. There is no problem with 0.8.1 but only with 0.8.2.
It might be a little difficult to share the code here, but I suspect that might due to a mistake of defining "dtype" variable somewhere in the latest version. You may check the error message:
Validation sanity check: 0it [00:00, ?it/s]
Traceback (most recent call last):
File "train.py", line 95, in <module>
main()
File "train.py", line 90, in main
trainer.fit(model)
File "/home/username/.local/lib/python3.7/site-packages/pytorch_lightning/trainer/trainer.py", line 928, in fit
self.single_gpu_train(model)
File "/home/username/.local/lib/python3.7/site-packages/pytorch_lightning/trainer/distrib_parts.py", line 183, in single_gpu_train
self.run_pretrain_routine(model)
File "/home/username/.local/lib/python3.7/site-packages/pytorch_lightning/trainer/trainer.py", line 1086, in run_pretrain_routine
False)
File "/home/username/.local/lib/python3.7/site-packages/pytorch_lightning/trainer/evaluation_loop.py", line 291, in _evaluate
output = self.evaluation_forward(model, batch, batch_idx, dataloader_idx, test_mode)
File "/home/username/.local/lib/python3.7/site-packages/pytorch_lightning/trainer/evaluation_loop.py", line 450, in evaluation_forward
batch = self.transfer_batch_to_gpu(batch, root_gpu)
File "/home/username/.local/lib/python3.7/site-packages/pytorch_lightning/trainer/distrib_parts.py", line 156, in transfer_batch_to_gpu
return self.__transfer_batch_to_device(batch, device)
File "/home/username/.local/lib/python3.7/site-packages/pytorch_lightning/trainer/distrib_parts.py", line 161, in __transfer_batch_to_device
return model.transfer_batch_to_device(batch, device)
File "/home/username/.local/lib/python3.7/site-packages/pytorch_lightning/core/hooks.py", line 243, in transfer_batch_to_device
return move_data_to_device(batch, device)
File "/home/username/.local/lib/python3.7/site-packages/pytorch_lightning/utilities/apply_func.py", line 109, in move_data_to_device
return apply_to_collection(batch, dtype=(TransferableDataType, Batch), function=batch_to)
File "/home/username/.local/lib/python3.7/site-packages/pytorch_lightning/utilities/apply_func.py", line 34, in apply_to_collection
if isinstance(data, dtype):
TypeError: isinstance() arg 2 must be a type or tuple of types
trainer.fit(model)
pytorch-lightning==0.8.2
Hi! thanks for your contribution!, great first issue!
could you try the master branch, we tried to fix it right now.
it will be in 0.8.3, sorry about that and thanks for reporting @qiaoruiyt
fixed by 92d1e75b2638a493d9d21ed5fe00a22093888285
Thanks!