MalConv-Pytorch icon indicating copy to clipboard operation
MalConv-Pytorch copied to clipboard

loss.cpu().data.numpy() is not a list

Open londumas opened this issue 5 years ago • 1 comments

I might be because of the newest version of pytorch or something else, but loss.cpu().data.numpy() is no longer a list and thus should be changed.

Before:

https://github.com/Alexander-H-Liu/MalConv-Pytorch/blob/939cb59ff1338dbc2b71a186f03bbc677b05c408/train.py#L151

https://github.com/Alexander-H-Liu/MalConv-Pytorch/blob/939cb59ff1338dbc2b71a186f03bbc677b05c408/train.py#L183

Now

history['tr_loss'].append(loss.cpu().data.numpy())
history['val_loss'].append(loss.cpu().data.numpy())

londumas avatar Feb 18 '20 09:02 londumas

duplicate of ticket https://github.com/Alexander-H-Liu/MalConv-Pytorch/issues/1

londumas avatar Feb 18 '20 09:02 londumas