Hi all
I am trying to optimize a 1D auto-encoder neural network. My batch size is 65536, and length of my signal is 94.
I used this code to optimizing my parameters:
/////////////////////////////////////////////////////////////////////////////////////////////
for epoch in range(num_epochs):
for data in y:
img, _ = data
img = Variable(img).cpu()
# ===================forward=====================
output = model(img)
loss = criterion(output, img)
# ===================backward====================
optimizer.zero_grad()
loss.backward()
optimizer.step()
# ===================log========================
print(‘epoch [{}/{}], loss:{:.4f}’
.format(epoch+1, num_epochs, loss.data[0]))
if epoch % 10 == 0:
pic = to_img(output.cpu().data)
save_image(pic, ‘./dc_img/image_{}.png’.format(epoch))
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
above y is my data set which is a tensor with dimension of [65536,1,94]. as I mentioned before, 65536 is my batch size, 1 is number of channel and 94 is length of my signal,
when I run the code, this error appeared:
ValueError: not enough values to unpack (expected 2, got 1)
has anyone any idea?
Thanks a lot