sraashis / retinal-fundus-transfer

An example of easytorch implementation on retinal vessel segmentation.
26 stars 4 forks source link

Issue at test phase #15

Open bobvo23 opened 3 years ago

bobvo23 commented 3 years ago

I tried to run the code. The training loop ran smoothly. However, it seems that there is a bug at the test phase

Reproduce

Clone the repository and ran the main python file

python main.py
20 sparse dataset loaded.
test ...
Traceback (most recent call last):
  File "main.py", line 47, in <module>
    runner.run(MyTrainer, MyDataset)
  File "/usr/local/lib/python3.7/dist-packages/easytorch/easytorch.py", line 286, in run
    self._run(trainer_cls, dataset_cls, data_handle_cls)
  File "/usr/local/lib/python3.7/dist-packages/easytorch/easytorch.py", line 328, in _run
    test_accum.append(self._test(split_file, trainer, test_dataset))
  File "/usr/local/lib/python3.7/dist-packages/easytorch/easytorch.py", line 270, in _test
    test_out = trainer.evaluation(mode='test', save_pred=True, distributed=False, dataset=test_dataset)
  File "/usr/local/lib/python3.7/dist-packages/easytorch/trainer.py", line 287, in evaluation
    update_scores(self.save_predictions(loader.dataset, its), its, avg, metrics)
  File "/content/unet-vessel-segmentation-easytorch/classification.py", line 118, in save_predictions
    patches = its['output']()[:, 1, :, :].cpu().numpy() * 255
TypeError: 'Tensor' object is not callable
sraashis commented 3 years ago

Could you try updating eeverything(easytoch and this repo) to latest and try again?