Skip to content

Error when training in the MNIST example #19

Description

@rkushol

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions