Open Tushar-N opened 8 years ago
Hi, I've recently observed something weird which might be related. I'm defining a network, and in forward() I have a slicing operation separating the first half of my channels:
first_half = input[:, :self.n_input_ch // 2, :, :]
This operation totally breaks down the training, i.e., after two or three training iterations the loss goes to nan.
However, if I do first_half = input[:, :self.n_input_ch // 2, :, :] * 1.0 instead, then everything works fine.
Is this a bug of slicing is not supposed to be used this way?
EDIT: Sorry, I think this is already addressed in this issue. I'm not too sure if it's because of the same reason or not. Apologies if this issue is a duplicate (I can't find a delete button!)
Hi,
I noticed a small issue when I slice np arrays and send them over to torch using pytorch - some of the values get set to inf on the torch side. Here's a small piece of code that replicates what I observed:
My output looks like:
Note that if I either: (1) Don't slice the array or (2) slice, but also multiply by 1.0 (
arr_slice = 1.0*arr[:,1:]
), then the issue disappears. Any idea why? (I'm using python2.7)PS: I've been juggling between fbtorch, several forks of lunatic-python, and putting up http servers in lua and querying from python. It's been a nightmare so far. Thank you so much for putting up this repo!