ai-med / quickNAT_pytorch

PyTorch Implementation of QuickNAT and Bayesian QuickNAT, a fast brain MRI segmentation framework with segmentation Quality control using structure-wise uncertainty
MIT License
101 stars 36 forks source link

Seems like a bug while training my own module... #32

Closed fhfhfh999 closed 2 years ago

fhfhfh999 commented 2 years ago

==== Epoch [ 1 / 10 ] START ==== <<<= Phase: train =>>> D:\Data\quickNAT_pytorch-master\venv\lib\site-packages\torch\optim\lr_scheduler.py:131: UserWarning: Detected call of lr_scheduler.step() before optimizer.step(). In PyTorch 1.1.0 and later, you should call them in the opposite order: optimizer.step() before lr_scheduler.step(). Failure to do this will result in PyTorch skipping the first value of the learning rate schedule. See more details at https://pytorch.org/docs/stable/optim.html#how-to-adjust-learning-rate warnings.warn("Detected call of lr_scheduler.step() before optimizer.step(). " Traceback (most recent call last): File "D:\Data\quickNAT_pytorch-master\run.py", line 187, in train(train_params, common_params, data_params, net_params) File "D:\Data\quickNAT_pytorch-master\run.py", line 57, in train solver.train(train_loader, val_loader) File "D:\Data\quickNAT_pytorch-master\solver.py", line 113, in train output = model(X) File "D:\Data\quickNAT_pytorch-master\venv\lib\site-packages\torch\nn\modules\module.py", line 1130, in _call_impl return forward_call(*input, *kwargs) File "D:\Data\quickNAT_pytorch-master\quicknat.py", line 49, in forward e1, out1, ind1 = self.encode1.forward(input) File "D:\Data\quickNAT_pytorch-master\venv\lib\site-packages\nn_common_modules\modules.py", line 151, in forward out_block = self.SELayer(out_block, weights) File "D:\Data\quickNAT_pytorch-master\venv\lib\site-packages\torch\nn\modules\module.py", line 1130, in _call_impl return forward_call(input, **kwargs) TypeError: forward() takes 2 positional arguments but 3 were given

I don't know whether it is a bug or my wrong operation...

fhfhfh999 commented 2 years ago

pytorch version cause this bug.