Hi
Thank you for your answer. Actually my data set is a 1d signal that has 65536 sample (batch number). Its one channel.
I edited my codes to the below, how ever I still get error.
#training loop
for epoch in range(num_epochs):
for data in (data_pixel2.shape[0]):
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))
/////////////////////////////////////////////////////////////////////////////////
data_pixel2 is a tensor size of [65536,1,94], that the first number indicates batch number and 1 means channel, and 94 means length of my signal.
Main reason of writing these codes was building an 1d autoencoder. However even I can’t run training loop