leohsuofnthu / Pytorch-IterativeFCN

Pytorch implementation of the paper Iterative fully convolutional neural networks for automatic vertebra segmentation accepted in MIDL2018.
61 stars 24 forks source link

It seems that the model was trained with only one subject? #7

Closed nnzzll closed 2 years ago

nnzzll commented 2 years ago

In train.py, you use next(iter(train_loader)) to fetch the patches every iteration.

However , in such way you build an iterator of train_loader every iteration,and next() would return the first element of the iterator every time, which means during the whole iteration there is only one subject is used to training.

I'm just confused about this.Could anyone give me some explanation or discussion?

nnzzll commented 2 years ago

OK, I found out that when setting shuffle=True in DataLoader, the __getitem__ method will return random index which is different every first time.