Skip to content

Attempting to train fails on loss funtion with L1_Charbonnier_loss returning empty #30

@rfogarty

Description

@rfogarty

We are experiencing the following attempting to train on some astrophotography images. I have created 128x128 patches of moon photos for our data set, and then used your generate Matlab routine to generate an HDF5 file.

We are attempting to train with: python main_lapsrn.py --nEpochs=50 --threads=1

Software versions do not appear to be specified, so we are using the following library versions in our conda environment:
Python: 3.8.5
PyTorch: 1.7.1
NumPy: 1.19.2
h5py: 2.10.0

We are experiencing the same error as well with SRDenseNet.

Epoch=1, lr=0.0001
Traceback (most recent call last):
File "main_lapsrn.py", line 140, in
main()
File "main_lapsrn.py", line 83, in main
train(training_data_loader, optimizer, model, criterion, epoch)
File "main_lapsrn.py", line 126, in train
print("===> Epoch{}: Loss: {:.10f}".format(epoch, iteration, len(training_data_loader), loss.data[0]))
IndexError: invalid index of a 0-dim tensor. Use tensor.item() in Python or tensor.item<T>() in C++ to convert a 0-dim tensor to a number

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions