jiangqy / DCMH-CVPR2017

source code for paper "Deep Cross-Modal Hashing"
99 stars 39 forks source link

the loss is NAN from 105 epoch #3

Closed qingchenwuhou closed 4 years ago

qingchenwuhou commented 6 years ago

Hi, Thanks for your code. I have a question that the loss is NAN from 105 epoch in the data set FLICKR-25K. Can you have any idea about the problem? I use the tensorflow code.

Many thanks!

ref: ...epoch: 102, loss: 27617250.477, comment: update B ...epoch: 103, loss: 27464020.237, comment: update B ...epoch: 104, loss: 27408385.730, comment: update B ...epoch: 105, loss: nan, comment: update B ...epoch: 106, loss: nan, comment: update B ...epoch: 107, loss: nan, comment: update B ...epoch: 108, loss: nan, comment: update B

jiangqy commented 6 years ago

I am not sure what is exact reason of this problem. It might be caused by logTrick problem. Specifically, we use the equation log(1+exp(x))=log(1+exp(-|x|))+max(0, x) to avoid numerical problem. E.g., in line 209, it might be cause a problem if use log(1+exp(x)). I didn't adopt this trick because I didn't have this problem. It might be work. pls change this term in loss_x loss_y and calc_loss.

Annie0109 commented 5 years ago

Hi, Thanks for your code. I have problems in running your code. Could you please help me? Thanks a lot!

File "DCMH/DCMH_demo.py", line 165, in net, _meanpix = img_net_strucuture(image_input, bit) File "/DCMH/net_structure_img.py", line 22, in img_net_strucuture kernels, bias = weights[i][0][0][0][0] ValueError: too many values to unpack

jiangqy commented 5 years ago

@Annie0109 Which version of imagenet-vgg-f.mat do you use? And I recommend you use matlab code.

Annie0109 commented 5 years ago

@Annie0109 Which version of imagenet-vgg-f.mat do you use? And I recommend you use matlab code.

I use this imagenet-vgg-f.mat http://www.vlfeat.org/matconvnet/models/imagenet-vgg-f.mat