juglab/FourierImageTransformer

Error when training in the MNIST example

rkushol opened this issue · 3 comments

When I uncomment the line trainer.fit(model, datamodule=dm) in the Super-Resolution - MNIST Example.ipynb file, I get this error TypeError: 'NoneType' object is not callable on line 53 of SResTransformer.py file. Could you please take a look why this is happening? I should mention that I had to change some stuff to get the code running. One change was the definition of the trainer object

trainer = Trainer(max_epochs=100, 
                  gpus=1, # set to 0 if you want to run on CPU
                  callbacks = [
                    ModelCheckpoint(
                        dirpath=None,
                        save_top_k=1,
                        verbose=False,
                        save_last=True,
                        monitor='Train/avg_val_loss',
                        mode='min',
                        # prefix='best_val_loss_'
                    )
                  ],
                  deterministic=True)

Another change was to change lines 76 and 77 in SResDataModule.py from

mnist_test = MNIST(self.root_dir, train=False, download=True).data.type(torch.float32)
mnist_train_val = MNIST(self.root_dir, train=True, download=True).data.type(torch.float32)

to

mnist_test = MNIST(self.root_dir, train=False, download=True).test_data.type(torch.float32)
mnist_train_val = MNIST(self.root_dir, train=True, download=True).train_data.type(torch.float32)

Hi @rkushol,

Thank you for reporting this issue. It looks like some underlying API has changed over the last months. Could you try to use pytorch-lightning==1.2.6?

Hello,
Thanks for your quick response. Tried with pytorch-lightning==1.2.6 but same error.

Hi @rkushol

I finally got around to look at it. I fixed a couple things that were broken and now it is running on my system again. If you find the time it would be appreciated if you could try it out again :)

Thank you!