TensorFlow-2.x-Tutorials icon indicating copy to clipboard operation
TensorFlow-2.x-Tutorials copied to clipboard

Gradients do not exist for variables

Open CanshangD opened this issue 6 years ago • 5 comments

I have got the error “Gradients do not exist for variables” when training faster rcnn, and the loss is nan.

log: W1108 09:59:39.735346 139647501481728 optimizer_v2.py:1029] Gradients do not exist for variables ['faster_rcnn/b_box_head/rcnn_class_conv1/kernel:0', 'faster_rcnn/b_box_head/rcnn_class_conv1/bias:0', 'faster_rcnn/b_box_head/rcnn_class_bn1/gamma:0', 'faster_rcnn/b_box_head/rcnn_class_bn1/beta:0', 'faster_rcnn/b_box_head/rcnn_class_conv2/kernel:0', 'faster_rcnn/b_box_head/rcnn_class_conv2/bias:0', 'faster_rcnn/b_box_head/rcnn_class_bn2/gamma:0', 'faster_rcnn/b_box_head/rcnn_class_bn2/beta:0', 'faster_rcnn/b_box_head/rcnn_class_logits/kernel:0', 'faster_rcnn/b_box_head/rcnn_class_logits/bias:0', 'faster_rcnn/b_box_head/rcnn_bbox_fc/kernel:0', 'faster_rcnn/b_box_head/rcnn_bbox_fc/bias:0'] when minimizing the loss. epoch 0 2 nan

CanshangD avatar Nov 08 '19 02:11 CanshangD

Got the same issue, couldn't solve it. Kindly post the solution if you have solved it.

MLForNerds avatar Nov 20 '19 06:11 MLForNerds

I have the same issue and for me too the loss is NaN. Please help

IngLP avatar Feb 24 '20 11:02 IngLP

same issue, loss becomes nan

xiaolng avatar Dec 23 '20 15:12 xiaolng

same issue, please help

flori-shan avatar Feb 16 '22 13:02 flori-shan

can you please say what file you were running when you got this error? what version(s) of pytorch and python etc ?

jgarza9788 avatar Jun 16 '22 08:06 jgarza9788