cosmic-cortex / pytorch-UNet

2D and 3D UNet implementation in PyTorch.
MIT License
147 stars 40 forks source link

Error in dataset.py after running training cmd #6

Open daddydrac opened 4 years ago

daddydrac commented 4 years ago

I ran:

python train.py --train_dataset images_folder/ --device 'cuda:0' --epochs 10 --save_freq 1 --save_model 1 --model_name round1 --crop 2560 --learning_rate 0.0001 --checkpoint_path checkpoint

Error output:

Traceback (most recent call last):
  File "train.py", line 40, in <module>
    val_dataset = ImageToImage2D(args.val_dataset, tf_val)
  File "/unet/pytorch-UNet/unet/dataset.py", line 122, in __init__
    self.input_path = os.path.join(dataset_path, 'images')
  File "/anaconda3/lib/python3.7/posixpath.py", line 80, in join
    a = os.fspath(a)
TypeError: expected str, bytes or os.PathLike object, not NoneType
getcontrol commented 4 years ago

Having same issue , in python 3.7 and 2.7

daddydrac commented 4 years ago

@getcontrol just use mine, it actually works: https://github.com/joehoeller/legendary-palm-tree

Beanocean commented 4 years ago

@joehoeller @getcontrol The path of val dataset is required, change the command as follow: python train.py \ --train_dataset imagesfolder/ \ **--val_dataset images_folder2/ . # Added Line** --device 'cuda:0' --epochs 10 \ --save_freq 1 --save_model 1 \ --model_name round1 --crop 256 \ --learning_rate 0.0001 \ --checkpoint_path checkpoint