hysts / pytorch_mpiigaze

An unofficial PyTorch implementation of MPIIGaze and MPIIFaceGaze
MIT License
346 stars 85 forks source link

"EOFError: Ran out of input" when running "python train.py --config configs/mpiigaze/lenet_train.yaml" #23

Closed tslever closed 3 years ago

tslever commented 4 years ago

hysts,

Would you be willing to help me debug the following "EOFError: Ran out of input", which I encountered after installing required libraries, downloading and extracting "MPIIGaze.tar.gz" to "C:\Users\thoma\Documents\AI\mpiigaze\datasets", running preprocess_mpiigaze.py, and executing "python train.py --config configs/mpiigaze/lenet_train.yaml"?

Thank you,

Tom Lever

EOFError
hysts commented 4 years ago

Hi, @tslever

I'm not sure, but this question in PyTorch forum seems to be relevant to your problem. Would you change this part of the code as follows and see if it works?

def _scale(x):
    return x.astype(np.float32) / 255

def _add_channel(x):
    return x[None, :, :]

def _create_mpiigaze_transform(config: yacs.config.CfgNode) -> Any:
    transform = torchvision.transforms.Compose([
        torchvision.transforms.Lambda(_scale),
        torch.from_numpy,
        torchvision.transforms.Lambda(_add_channel),
    ])
    return transform
tslever commented 4 years ago

Commenting and inserting the following code resulted in the following error.

modification error
hysts commented 4 years ago

@tslever

I suppose the error has something to do with this issue. What is your PyTorch version? It seems to have been fixed in 1.5.1. I tried older versions and got the error in 1.5.0 but not in 1.5.1 or 1.6.0 on Ubuntu.

tslever commented 3 years ago

I'm running torch 1.6.0 and torchvision 0.7.0 on Windows 10. I think I'll switch to Ubuntu, unless you have other suggestions.

hysts commented 3 years ago

@tslever

I see. So it's not a version problem. I think it would be easier to switch to Ubuntu too.