akaraspt / deepsleepnet

DeepSleepNet: a Model for Automatic Sleep Stage Scoring based on Raw Single-Channel EEG
Apache License 2.0
395 stars 152 forks source link

Value error in optimize.py of the deepsleep folder after complete pre-training. #9

Closed AbhayKoushik closed 6 years ago

AbhayKoushik commented 6 years ago

Hi Akara, I successfully updated the full code of deepsleepnet to tensorflow 1.5. There happens to be an error in optimization after the completion of convolutional pre-training. To exactly point out where the error is, I printed the optimizing parameters as shown in the screenshot attached. The list train_vars2 happens to be empty which is why the opt.applygradients(gvs) is giving us ValueError: No variables provided. in the second run of that loop. optimize

Here is the traceback.

Traceback (most recent call last): File "train.py", line 95, in tf.app.run() File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/platform/app.py", line 124, in run _sys.exit(main(argv)) File "train.py", line 90, in main n_epochs=FLAGS.finetune_epochs File "train.py", line 72, in finetune resume=FLAGS.resume File "/home/DeepSleepNet/deepsleepnet/deepsleep/trainer.py", line 626, in finetune clip_value=10.0 File "/home/DeepSleepNet/deepsleepnet/deepsleep/optimize.py", line 60, in adam_clipping_list_lr apply_gradient_op = opt.apply_gradients(gvs) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/optimizer.py", line 493, in apply_gradients raise ValueError("No variables provided.") ValueError: No variables provided.

Please help me out in resolving this error.

Best Regards, Abhay.

akaraspt commented 6 years ago

Can you print out the lists of tf.trainable_variables(), train_vars1 and train_vars2?

AbhayKoushik commented 6 years ago

As in the screenshot above: Optimizing parameters is same as train_vars2 which happens to be empty as shown in the screenshot below which is exactly why the ValueError. Pretrained parameters is same as train_vars1 which is not an empty list. printedlists

akaraspt commented 6 years ago

My guest is that you use the incorrect class for this trainer.

train_vars1 should contains parameters of the two CNNs train_vars2 should contains parameters of the Bi-LSTM

Can you please check whether you use DeepFeatureNet instead of DeepSleepNet?

AbhayKoushik commented 6 years ago

I too think that is the problem, As you suggested I printed those values again, here they are.

trainable_variables 
[<tf.Variable 'deepsleepnet/l1_conv/conv1d/weights:0' shape=(50, 1, 1, 64) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l1_conv/bn/beta:0' shape=(64,) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l1_conv/bn/gamma:0' shape=(64,) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l4_conv/conv1d/weights:0' shape=(8, 1, 64, 128) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l4_conv/bn/beta:0' shape=(128,) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l4_conv/bn/gamma:0' shape=(128,) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l5_conv/conv1d/weights:0' shape=(8, 1, 128, 128) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l5_conv/bn/beta:0' shape=(128,) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l5_conv/bn/gamma:0' shape=(128,) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l6_conv/conv1d/weights:0' shape=(8, 1, 128, 128) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l6_conv/bn/beta:0' shape=(128,) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l6_conv/bn/gamma:0' shape=(128,) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l9_conv/conv1d/weights:0' shape=(400, 1, 1, 64) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l9_conv/bn/beta:0' shape=(64,) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l9_conv/bn/gamma:0' shape=(64,) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l12_conv/conv1d/weights:0' shape=(6, 1, 64, 128) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l12_conv/bn/beta:0' shape=(128,) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l12_conv/bn/gamma:0' shape=(128,) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l13_conv/conv1d/weights:0' shape=(6, 1, 128, 128) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l13_conv/bn/beta:0' shape=(128,) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l13_conv/bn/gamma:0' shape=(128,) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l14_conv/conv1d/weights:0' shape=(6, 1, 128, 128) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l14_conv/bn/beta:0' shape=(128,) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l14_conv/bn/gamma:0' shape=(128,) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l19_softmax_linear/weights:0' shape=(3072, 5) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l19_softmax_linear/biases:0' shape=(5,) dtype=float32_ref>]

train_vars1 
[<tf.Variable 'deepsleepnet/l1_conv/conv1d/weights:0' shape=(50, 1, 1, 64) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l1_conv/bn/beta:0' shape=(64,) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l1_conv/bn/gamma:0' shape=(64,) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l4_conv/conv1d/weights:0' shape=(8, 1, 64, 128) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l4_conv/bn/beta:0' shape=(128,) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l4_conv/bn/gamma:0' shape=(128,) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l5_conv/conv1d/weights:0' shape=(8, 1, 128, 128) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l5_conv/bn/beta:0' shape=(128,) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l5_conv/bn/gamma:0' shape=(128,) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l6_conv/conv1d/weights:0' shape=(8, 1, 128, 128) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l6_conv/bn/beta:0' shape=(128,) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l6_conv/bn/gamma:0' shape=(128,) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l9_conv/conv1d/weights:0' shape=(400, 1, 1, 64) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l9_conv/bn/beta:0' shape=(64,) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l9_conv/bn/gamma:0' shape=(64,) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l12_conv/conv1d/weights:0' shape=(6,pretrained_model_name = "DeepSleepNet" 1, 64, 128) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l12_conv/bn/beta:0' shape=(128,) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l12_conv/bn/gamma:0' shape=(128,) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l13_conv/conv1d/weights:0' shape=(6, 1, 128, 128) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l13_conv/bn/beta:0' shape=(128,) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l13_conv/bn/gamma:0' shape=(128,) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l14_conv/conv1d/weights:0' shape=(6, 1, 128, 128) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l14_conv/bn/beta:0' shape=(128,) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l14_conv/bn/gamma:0' shape=(128,) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l19_softmax_linear/weights:0' shape=(3072, 5) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l19_softmax_linear/biases:0' shape=(5,) dtype=float32_ref>]

train_vars2 
[]
Traceback (most recent call last):
  File "train.py", line 95, in <module>
    tf.app.run()
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/platform/app.py", line 124, in run
    _sys.exit(main(argv))
  File "train.py", line 90, in main
    n_epochs=FLAGS.finetune_epochs
  File "train.py", line 72, in finetune
    resume=FLAGS.resume
  File "/home/Abhay/SleepInterfacing/DeepSleepNet/deepsleepnet/deepsleep/trainer.py", line 633, in finetune
    clip_value=10.0
  File "/home/Abhay/SleepInterfacing/DeepSleepNet/deepsleepnet/deepsleep/optimize.py", line 60, in adam_clipping_list_lr
    apply_gradient_op = opt.apply_gradients(gvs)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/optimizer.py", line 493, in apply_gradients
    raise ValueError("No variables provided.")
ValueError: No variables provided.>

This is using DeepFeatureNet in the finetune function of the trainer.py pretrained_model_name = "DeepFeatureNet"

CNN Parameters ,that is, train_vars1 is available and the pre-training is complete. Bidirectional LSTM parameters, that is, are empty.

And Next, after the convolutionally trained model is saved, I changed: pretrained_model_name = "DeepSleepNet" and I have the same error but now train_vars1 is empty and train_vars2 is available.

trainable_variables 
[<tf.Variable 'deepsleepnet/l1_conv/conv1d/weights:0' shape=(50, 1, 1, 64) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l1_conv/bn/beta:0' shape=(64,) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l1_conv/bn/gamma:0' shape=(64,) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l4_conv/conv1d/weights:0' shape=(8, 1, 64, 128) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l4_conv/bn/beta:0' shape=(128,) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l4_conv/bn/gamma:0' shape=(128,) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l5_conv/conv1d/weights:0' shape=(8, 1, 128, 128) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l5_conv/bn/beta:0' shape=(128,) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l5_conv/bn/gamma:0' shape=(128,) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l6_conv/conv1d/weights:0' shape=(8, 1, 128, 128) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l6_conv/bn/beta:0' shape=(128,) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l6_conv/bn/gamma:0' shape=(128,) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l9_conv/conv1d/weights:0' shape=(400, 1, 1, 64) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l9_conv/bn/beta:0' shape=(64,) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l9_conv/bn/gamma:0' shape=(64,) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l12_conv/conv1d/weights:0' shape=(6, 1, 64, 128) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l12_conv/bn/beta:0' shape=(128,) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l12_conv/bn/gamma:0' shape=(128,) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l13_conv/conv1d/weights:0' shape=(6, 1, 128, 128) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l13_conv/bn/beta:0' shape=(128,) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l13_conv/bn/gamma:0' shape=(128,) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l14_conv/conv1d/weights:0' shape=(6, 1, 128, 128) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l14_conv/bn/beta:0' shape=(128,) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l14_conv/bn/gamma:0' shape=(128,) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l19_softmax_linear/weights:0' shape=(3072, 5) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l19_softmax_linear/biases:0' shape=(5,) dtype=float32_ref>]

train_vars1 
[]

train_vars2 
[<tf.Variable 'deepsleepnet/l4_conv/conv1d/weights:0' shape=(8, 1, 64, 128) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l1_conv/bn/beta:0' shape=(64,) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l4_conv/bn/gamma:0' shape=(128,) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l9_conv/bn/beta:0' shape=(64,) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l5_conv/conv1d/weights:0' shape=(8, 1, 128, 128) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l6_conv/bn/beta:0' shape=(128,) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l9_conv/conv1d/weights:0' shape=(400, 1, 1, 64) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l13_conv/conv1d/weights:0' shape=(6, 1, 128, 128) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l6_conv/conv1d/weights:0' shape=(8, 1, 128, 128) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l9_conv/bn/gamma:0' shape=(64,) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l14_conv/conv1d/weights:0' shape=(6, 1, 128, 128) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l12_conv/conv1d/weights:0' shape=(6, 1, 64, 128) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l5_conv/bn/gamma:0' shape=(128,) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l5_conv/bn/beta:0' shape=(128,) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l1_conv/conv1d/weights:0' shape=(50, 1, 1, 64) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l6_conv/bn/gamma:0' shape=(128,) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l19_softmax_linear/weights:0' shape=(3072, 5) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l12_conv/bn/gamma:0' shape=(128,) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l13_conv/bn/beta:0' shape=(128,) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l1_conv/bn/gamma:0' shape=(64,) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l13_conv/bn/gamma:0' shape=(128,) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l4_conv/bn/beta:0' shape=(128,) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l12_conv/bn/beta:0' shape=(128,) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l19_softmax_linear/biases:0' shape=(5,) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l14_conv/bn/gamma:0' shape=(128,) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l14_conv/bn/beta:0' shape=(128,) dtype=float32_ref>]
Traceback (most recent call last):
  File "train.py", line 95, in <module>
    tf.app.run()
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/platform/app.py", line 124, in run
    _sys.exit(main(argv))
  File "train.py", line 90, in main
    n_epochs=FLAGS.finetune_epochs
  File "train.py", line 72, in finetune
    resume=FLAGS.resume
  File "/home/Abhay/SleepInterfacing/DeepSleepNet/deepsleepnet/deepsleep/trainer.py", line 633, in finetune
    clip_value=10.0
  File "/home/Abhay/SleepInterfacing/DeepSleepNet/deepsleepnet/deepsleep/optimize.py", line 60, in adam_clipping_list_lr
    apply_gradient_op = opt.apply_gradients(gvs)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/optimizer.py", line 493, in apply_gradients
    raise ValueError("No variables provided.")
ValueError: No variables provided.

So apparently we need both together for the optimization code to run. Can you please help me now?

akaraspt commented 6 years ago

Can you help debugging the L597-L599 in your figure below?

https://user-images.githubusercontent.com/17530993/35916175-8a7f103e-0c2f-11e8-8686-9f375304a889.png

This can be done by printing all variables involved in these lines (before and after these lines are executed).

I am trying to identify the root cause.

AbhayKoushik commented 6 years ago

Here they are

traineropt

Trainable Variables:
deepsleepnet/l1_conv/conv1d/weights:0 (50, 1, 1, 64)
deepsleepnet/l1_conv/bn/beta:0 (64,)
deepsleepnet/l1_conv/bn/gamma:0 (64,)
deepsleepnet/l4_conv/conv1d/weights:0 (8, 1, 64, 128)
deepsleepnet/l4_conv/bn/beta:0 (128,)
deepsleepnet/l4_conv/bn/gamma:0 (128,)
deepsleepnet/l5_conv/conv1d/weights:0 (8, 1, 128, 128)
deepsleepnet/l5_conv/bn/beta:0 (128,)
deepsleepnet/l5_conv/bn/gamma:0 (128,)
deepsleepnet/l6_conv/conv1d/weights:0 (8, 1, 128, 128)
deepsleepnet/l6_conv/bn/beta:0 (128,)
deepsleepnet/l6_conv/bn/gamma:0 (128,)
deepsleepnet/l9_conv/conv1d/weights:0 (400, 1, 1, 64)
deepsleepnet/l9_conv/bn/beta:0 (64,)
deepsleepnet/l9_conv/bn/gamma:0 (64,)
deepsleepnet/l12_conv/conv1d/weights:0 (6, 1, 64, 128)
deepsleepnet/l12_conv/bn/beta:0 (128,)
deepsleepnet/l12_conv/bn/gamma:0 (128,)
deepsleepnet/l13_conv/conv1d/weights:0 (6, 1, 128, 128)
deepsleepnet/l13_conv/bn/beta:0 (128,)
deepsleepnet/l13_conv/bn/gamma:0 (128,)
deepsleepnet/l14_conv/conv1d/weights:0 (6, 1, 128, 128)
deepsleepnet/l14_conv/bn/beta:0 (128,)
deepsleepnet/l14_conv/bn/gamma:0 (128,)
deepsleepnet/l19_softmax_linear/weights:0 (3072, 5)
deepsleepnet/l19_softmax_linear/biases:0 (5,)

All Variables:
deepsleepnet/l1_conv/conv1d/weights:0 (50, 1, 1, 64)
deepsleepnet/l1_conv/bn/beta:0 (64,)
deepsleepnet/l1_conv/bn/gamma:0 (64,)
deepsleepnet/l1_conv/bn/moving_mean:0 (64,)
deepsleepnet/l1_conv/bn/moving_variance:0 (64,)
deepsleepnet/l4_conv/conv1d/weights:0 (8, 1, 64, 128)
deepsleepnet/l4_conv/bn/beta:0 (128,)
deepsleepnet/l4_conv/bn/gamma:0 (128,)
deepsleepnet/l4_conv/bn/moving_mean:0 (128,)
deepsleepnet/l4_conv/bn/moving_variance:0 (128,)
deepsleepnet/l5_conv/conv1d/weights:0 (8, 1, 128, 128)
deepsleepnet/l5_conv/bn/beta:0 (128,)
deepsleepnet/l5_conv/bn/gamma:0 (128,)
deepsleepnet/l5_conv/bn/moving_mean:0 (128,)
deepsleepnet/l5_conv/bn/moving_variance:0 (128,)
deepsleepnet/l6_conv/conv1d/weights:0 (8, 1, 128, 128)
deepsleepnet/l6_conv/bn/beta:0 (128,)
deepsleepnet/l6_conv/bn/gamma:0 (128,)
deepsleepnet/l6_conv/bn/moving_mean:0 (128,)
deepsleepnet/l6_conv/bn/moving_variance:0 (128,)
deepsleepnet/l9_conv/conv1d/weights:0 (400, 1, 1, 64)
deepsleepnet/l9_conv/bn/beta:0 (64,)
deepsleepnet/l9_conv/bn/gamma:0 (64,)
deepsleepnet/l9_conv/bn/moving_mean:0 (64,)
deepsleepnet/l9_conv/bn/moving_variance:0 (64,)
deepsleepnet/l12_conv/conv1d/weights:0 (6, 1, 64, 128)
deepsleepnet/l12_conv/bn/beta:0 (128,)
deepsleepnet/l12_conv/bn/gamma:0 (128,)
deepsleepnet/l12_conv/bn/moving_mean:0 (128,)
deepsleepnet/l12_conv/bn/moving_variance:0 (128,)
deepsleepnet/l13_conv/conv1d/weights:0 (6, 1, 128, 128)
deepsleepnet/l13_conv/bn/beta:0 (128,)
deepsleepnet/l13_conv/bn/gamma:0 (128,)
deepsleepnet/l13_conv/bn/moving_mean:0 (128,)
deepsleepnet/l13_conv/bn/moving_variance:0 (128,)
deepsleepnet/l14_conv/conv1d/weights:0 (6, 1, 128, 128)
deepsleepnet/l14_conv/bn/beta:0 (128,)
deepsleepnet/l14_conv/bn/gamma:0 (128,)
deepsleepnet/l14_conv/bn/moving_mean:0 (128,)
deepsleepnet/l14_conv/bn/moving_variance:0 (128,)
deepsleepnet/l19_softmax_linear/weights:0 (3072, 5)
deepsleepnet/l19_softmax_linear/biases:0 (5,)

Pretrain Params
deepfeaturenet/l5_conv/conv1d/weights/Adam:0
deepfeaturenet/l6_conv/bn/beta/Adam:0
deepfeaturenet/l9_conv/bn/gamma/Adam:0
deepfeaturenet/l6_conv/bn/gamma/Adam:0
deepfeaturenet/l1_c```onv/conv1d/weights:0
deepfeaturenet/l5_conv/bn/beta/Adam_1:0
deepfeaturenet/l5_conv/bn/moving_mean:0
deepfeaturenet/l5_conv/conv1d/weights/Adam_1:0
deepfeaturenet/l6_conv/bn/moving_mean:0
deepfeaturenet/l4_conv/conv1d/weights/Adam:0
deepfeaturenet/l4_conv/bn/beta/Adam_1:0
deepfeaturenet/l4_conv/bn/gamma/Adam:0
deepfeaturenet/l19_softmax_linear/weights/Adam_1:0
deepfeaturenet/l13_conv/bn/gamma/Adam_1:0
deepfeaturenet/l4_conv/bn/beta:0
deepfeaturenet/l14_conv/bn/beta/Adam_1:0
deepfeaturenet/l9_conv/bn/moving_mean:0
deepfeaturenet/l14_conv/conv1d/weights:0
deepfeaturenet/l5_conv/bn/gamma:0
deepfeaturenet/l4_conv/bn/gamma/Adam_1:0
deepfeaturenet/l9_conv/bn/beta/Adam:0
deepfeaturenet/l5_conv/bn/beta/Adam:0
deepfeaturenet/l6_conv/conv1d/weights/Adam_1:0
deepfeaturenet/l4_conv/bn/gamma:0
deepfeaturenet/l12_conv/bn/gamma/Adam:0
deepfeaturenet/l12_conv/bn/beta/Adam_1:0
deepfeaturenet/l9_conv/bn/moving_variance:0
deepfeaturenet_2/global_step:0
deepfeaturenet/l13_conv/conv1d/weights/Adam_1:0
deepfeaturenet/l9_conv/bn/beta:0
deepfeaturenet/l12_conv/conv1d/weights/Adam:0
deepfeaturenet/l6_conv/conv1d/weights:0
deepfeaturenet/l4_conv/bn/beta/Adam:0
deepfeaturenet/l19_softmax_linear/biases/Adam_1:0
deepfeaturenet/l14_conv/conv1d/weights/Adam:0
deepfeaturenet/l4_conv/bn/moving_mean:0
deepfeaturenet/l6_conv/bn/beta/Adam_1:0
deepfeaturenet/l13_conv/bn/moving_mean:0
deepfeaturenet/l13_conv/bn/gamma:0
deepfeaturenet/l1_conv/bn/gamma:0
deepfeaturenet/l14_con```v/bn/gamma/Adam_1:0
deepfeaturenet/l9_conv/conv1d/weights:0
deepfeaturenet/l12_conv/conv1d/weights/Adam_1:0
deepfeaturenet/l1_conv/bn/gamma/Adam:0
deepfeaturenet/l9_conv/conv1d/weights/Adam_1:0
deepfeaturenet/l6_conv/bn/moving_variance:0
deepfeaturenet/l5_conv/bn/gamma/Adam:0
deepfeaturenet/l9_conv/conv1d/weights/Adam:0
deepfeaturenet/l19_softmax_linear/weights/Adam:0
deepfeaturenet/l6_conv/bn/gamma:0
deepfeaturenet/l12_conv/bn/beta/Adam:0
deepfeaturenet/l13_conv/bn/moving_variance:0
deepfeaturenet/l4_conv/conv1d/weights:0
deepfeaturenet/l13_conv/bn/gamma/Adam:0
deepfeaturenet/l19_softmax_linear/biases/Adam:0
deepfeaturenet/l13_conv/bn/beta/Adam_1:0
deepfeaturenet/l5_conv/bn/moving_variance:0
deepfeaturenet/l9_conv/bn/gamma:0
deepfeaturenet/l1_conv/bn/moving_mean:0
deepfeaturenet/l4_conv/bn/moving_variance:0
deepfeaturenet/l19_softmax_linear/weights:0
beta1_power:0
deepfeaturenet/l1_conv/bn/moving_variance:0
deepfeaturenet/l6_conv/conv1d/weights/Adam:0
deepfeaturenet/l13_conv/bn/beta:0
deepfeaturenet/l12_conv/bn/moving_mean:0
deepfeaturenet/l14_conv/bn/beta:0
deepfeaturenet/l14_conv/bn/gamma:0
deepfeaturenet/l14_conv/bn/moving_mean:0
deepfeaturenet/l13_conv/conv1d/weights:0
deepfeaturenet/l5_conv/conv1d/weights:0
deepfeaturenet/l12_conv/bn/beta:0
deepfeaturenet/l1_conv/bn/beta/Adam_1:0
deepfeaturenet/l4_conv/conv1d/weights/Adam_1:0
deepfeaturenet/l12_conv/conv1d/weights:0
beta2_power:0
deepfeaturenet/l1_conv/bn/beta:0
deepfeaturenet/l13_conv/bn/beta/Adam:0
deepfeaturenet/l14_conv/conv1d/weights/Adam_1:0
deepfeaturenet/l13_conv/conv1d/weights/Adam:0
deepfeaturenet/l6_conv/bn/gamma/Adam_1:0
deepfeaturenet/l6_conv/bn/beta:0
deepfeaturenet/l1_conv/conv1d/weights/Adam:0
deepfeaturenet/l1_conv/bn/beta/Adam:0
deepfeaturenet/l9_conv/bn/beta/Adam_1:0
deepfeaturenet/l12_conv/bn/gamma:0
deepfeaturenet/l1_conv/bn/gamma/Adam_1:0
deepfeaturenet/l14_conv/bn/moving_variance:0
deepfeaturenet/l9_conv/bn/gamma/Adam_1:0
deepfeaturenet/l12_conv/bn/moving_variance:0
deepfeaturenet/l5_conv/bn/gamma/Adam_1:0
deepfeaturenet/l12_conv/bn/gamma/Adam_1:0
deepfeaturenet/l5_conv/bn/beta:0
deepfeaturenet/l14_conv/bn/beta/Adam:0
deepfeaturenet/l1_conv/conv1d/weights/Adam_1:0
deepfeaturenet/l14_conv/bn/gamma/Adam:0
deepfeaturenet/l19_softmax_linear/biases:0

Pretrained parameters:

Optimizing parameters:
deepsleepnet/l9_conv/conv1d/weights:0
deepsleepnet/l5_conv/bn/gamma:0
deepsleepnet/l9_conv/bn/gamma:0
deepsleepnet/l5_conv/conv1d/weights:0
deepsleepnet/l6_conv/bn/beta:0
deepsleepnet/l4_conv/conv1d/weights:0
deepsleepnet/l13_conv/conv1d/weights:0
deepsleepnet/l6_conv/conv1d/weights:0
deepsleepnet/l4_conv/bn/gamma:0
deepsleepnet/l14_conv/conv1d/weights:0
deepsleepnet/l1_conv/bn/beta:0
deepsleepnet/l4_conv/bn/beta:0
deepsleepnet/l9_conv/bn/beta:0
deepsleepnet/l5_conv/bn/beta:0
deepsleepnet/l1_conv/conv1d/weights:0
deepsleepnet/l13_conv/bn/beta:0
deepsleepnet/l19_softmax_linear/weights:0
deepsleepnet/l12_conv/bn/gamma:0
deepsleepnet/l6_conv/bn/gamma:0
deepsleepnet/l1_conv/bn/gamma:0
deepsleepnet/l13_conv/bn/gamma:0
deepsleepnet/l12_conv/conv1d/weights:0
deepsleepnet/l12_conv/bn/beta:0
deepsleepnet/l19_softmax_linear/biases:0
deepsleepnet/l14_conv/bn/gamma:0
deepsleepnet/l14_conv/bn/beta:0

Trainable Variables:
deepsleepnet/l1_conv/conv1d/weights:0 (50, 1, 1, 64)
deepsleepnet/l1_conv/bn/beta:0 (64,)
deepsleepnet/l1_conv/bn/gamma:0 (64,)
deepsleepnet/l4_conv/conv1d/weights:0 (8, 1, 64, 128)
deepsleepnet/l4_conv/bn/beta:0 (128,)
deepsleepnet/l4_conv/bn/gamma:0 (128,)
deepsleepnet/l5_conv/conv1d/weights:0 (8, 1, 128, 128)
deepsleepnet/l5_conv/bn/beta:0 (128,)
deepsleepnet/l5_conv/bn/gamma:0 (128,)
deepsleepnet/l6_conv/conv1d/weights:0 (8, 1, 128, 128)
deepsleepnet/l6_conv/bn/beta:0 (128,)
deepsleepnet/l6_conv/bn/gamma:0 (128,)
deepsleepnet/l9_conv/conv1d/weights:0 (400, 1, 1, 64)
deepsleepnet/l9_conv/bn/beta:0 (64,)
deepsleepnet/l9_conv/bn/gamma:0 (64,)
deepsleepnet/l12_conv/conv1d/weights:0 (6, 1, 64, 128)
deepsleepnet/l12_conv/bn/beta:0 (128,)
deepsleepnet/l12_conv/bn/gamma:0 (128,)
deepsleepnet/l13_conv/conv1d/weights:0 (6, 1, 128, 128)
deepsleepnet/l13_conv/bn/beta:0 (128,)
deepsleepnet/l13_conv/bn/gamma:0 (128,)
deepsleepnet/l14_conv/conv1d/weights:0 (6, 1, 128, 128)
deepsleepnet/l14_conv/bn/beta:0 (128,)
deepsleepnet/l14_conv/bn/gamma:0 (128,)
deepsleepnet/l19_softmax_linear/weights:0 (3072, 5)
deepsleepnet/l19_softmax_linear/biases:0 (5,)

All Variables:
deepsleepnet/l1_conv/conv1d/weights:0 (50, 1, 1, 64)
deepsleepnet/l1_conv/bn/beta:0 (64,)
deepsleepnet/l1_conv/bn/gamma:0 (64,)
deepsleepnet/l1_conv/bn/moving_mean:0 (64,)
deepsleepnet/l1_conv/bn/moving_variance:0 (64,)
deepsleepnet/l4_conv/conv1d/weights:0 (8, 1, 64, 128)
deepsleepnet/l4_conv/bn/beta:0 (128,)
deepsleepnet/l4_conv/bn/gamma:0 (128,)
deepsleepnet/l4_conv/bn/moving_mean:0 (128,)
deepsleepnet/l4_conv/bn/moving_variance:0 (128,)
deepsleepnet/l5_conv/conv1d/weights:0 (8, 1, 128, 128)
deepsleepnet/l5_conv/bn/beta:0 (128,)
deepsleepnet/l5_conv/bn/gamma:0 (128,)
deepsleepnet/l5_conv/bn/moving_mean:0 (128,)
deepsleepnet/l5_conv/bn/moving_variance:0 (128,)
deepsleepnet/l6_conv/conv1d/weights:0 (8, 1, 128, 128)
deepsleepnet/l6_conv/bn/beta:0 (128,)
deepsleepnet/l6_conv/bn/gamma:0 (128,)
deepsleepnet/l6_conv/bn/moving_mean:0 (128,)
deepsleepnet/l6_conv/bn/moving_variance:0 (128,)
deepsleepnet/l9_conv/conv1d/weights:0 (400, 1, 1, 64)
deepsleepnet/l9_conv/bn/beta:0 (64,)
deepsleepnet/l9_conv/bn/gamma:0 (64,)
deepsleepnet/l9_conv/bn/moving_mean:0 (64,)
deepsleepnet/l9_conv/bn/moving_variance:0 (64,)
deepsleepnet/l12_conv/conv1d/weights:0 (6, 1, 64, 128)
deepsleepnet/l12_conv/bn/beta:0 (128,)
deepsleepnet/l12_conv/bn/gamma:0 (128,)
deepsleepnet/l12_conv/bn/moving_mean:0 (128,)
deepsleepnet/l12_conv/bn/moving_variance:0 (128,)
deepsleepnet/l13_conv/conv1d/weights:0 (6, 1, 128, 128)
deepsleepnet/l13_conv/bn/beta:0 (128,)
deepsleepnet/l13_conv/bn/gamma:0 (128,)
deepsleepnet/l13_conv/bn/moving_mean:0 (128,)
deepsleepnet/l13_conv/bn/moving_variance:0 (128,)
deepsleepnet/l14_conv/conv1d/weights:0 (6, 1, 128, 128)
deepsleepnet/l14_conv/bn/beta:0 (128,)
deepsleepnet/l14_conv/bn/gamma:0 (128,)
deepsleepnet/l14_conv/bn/moving_mean:0 (128,)
deepsleepnet/l14_conv/bn/moving_variance:0 (128,)
deepsleepnet/l19_softmax_linear/weights:0 (3072, 5)
deepsleepnet/l19_softmax_linear/biases:0 (5,)

trainable_variables 
[<tf.Variable 'deepsleepnet/l1_conv/conv1d/weights:0' shape=(50, 1, 1, 64) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l1_conv/bn/beta:0' shape=(64,) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l1_conv/bn/gamma:0' shape=(64,) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l4_conv/conv1d/weights:0' shape=(8, 1, 64, 128) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l4_conv/bn/beta:0' shape=(128,) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l4_conv/bn/gamma:0' shape=(128,) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l5_conv/conv1d/weights:0' shape=(8, 1, 128, 128) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l5_conv/bn/beta:0' shape=(128,) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l5_conv/bn/gamma:0' shape=(128,) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l6_conv```/conv1d/weights:0' shape=(8, 1, 128, 128) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l6_conv/bn/beta:0' shape=(128,) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l6_conv/bn/gamma:0' shape=(128,) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l9_conv/conv1d/weights:0' shape=(400, 1, 1, 64) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l9_conv/bn/beta:0' shape=(64,) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l9_conv/bn/gamma:0' shape=(64,) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l12_conv/conv1d/weights:0' shape=(6, 1, 64, 128) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l12_conv/bn/beta:0' shape=(128,) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l12_conv/bn/gamma:0' shape=(128,) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l13_conv/conv1d/weights:0' shape=(6, 1, 128, 128) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l13_conv/bn/beta:0' shape=(128,) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l13_conv/bn/gamma:0' shape=(128,) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l14_conv/conv1d/weights:0' shape=(6, 1, 128, 128) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l14_conv/bn/beta:0' shape=(128,) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l14_conv/bn/gamma:0' shape=(128,) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l19_softmax_linear/weights:0' shape=(3072, 5) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l19_softmax_linear/biases:0' shape=(5,) dtype=float32_ref>]

train_vars1 
[]

train_vars2 
[<tf.Variable 'deepsleepnet/l9_conv/conv1d/weights:0' shape=(400, 1, 1, 64) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l5_conv/bn/gamma:0' shape=(128,) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l9_conv/bn/gamma:0' shape=(64,) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l5_conv/conv1d/weights:0' shape=(8, 1, 128, 128) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l6_conv/bn/beta:0' shape=(128,) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l4_conv/conv1d/weights:0' shape=(8, 1, 64, 128) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l13_conv/conv1d/weights:0' shape=(6, 1, 128, 128) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l6_conv/conv1d/weights:0' shape=(8, 1, 128, 128) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l4_conv/bn/gamma:0' shape=(128,) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l14_conv/conv1d/weights:0' shape=(6, 1, 128, 128) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l1_conv/bn/beta:0' shape=(64,) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l4_conv/bn/beta:0' shape=(128,) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l9_conv/bn/beta:0' shape=(64,) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l5_conv/bn/beta:0' shape=(128,) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l1_conv/conv1d/weights:0' shape=(50, 1, 1, 64) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l13_conv/bn/beta:0' shape=(128,) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l19_softmax_linear/weights:0' shape=(3072, 5) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l12_conv/bn/gamma:0' shape=(128,) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l6_conv/bn/gamma:0' shape=(128,) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l1_conv/bn/gamma:0' shape=(64,) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l13_con```v/bn/gamma:0' shape=(128,) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l12_conv/conv1d/weights:0' shape=(6, 1, 64, 128) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l12_conv/bn/beta:0' shape=(128,) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l19_softmax_linear/biases:0' shape=(5,) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l14_conv/bn/gamma:0' shape=(128,) dtype=float32_ref>, <tf.Variable 'deepsleepnet/l14_conv/bn/beta:0' shape=(128,) dtype=float32_ref>]
Traceback (most recent call last):
  File "train.py", line 95, in <module>
    tf.app.run()
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/platform/app.py", line 124, in run
    _sys.exit(main(argv))
  File "train.py", line 90, in main
    n_epochs=FLAGS.finetune_epochs
  File "train.py", line 72, in finetune
    resume=FLAGS.resume
  File "/home/Abhay/Documents/SleepInterfacing/DeepSleepNet/deepsleepnet/deepsleep/trainer.py", line 648, in finetune
    clip_value=10.0
  File "/home/Abhay/Documents/SleepInterfacing/DeepSleepNet/deepsleepnet/deepsleep/optimize.py", line 60, in adam_clipping_list_lr
    apply_gradient_op = opt.apply_gradients(gvs)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/optimizer.py", line 493, in apply_gradients
    raise ValueError("No variables provided.")
ValueError: No variables provided.

Please go through this and let me know what the next steps of debugging are. Thanks!

akaraspt commented 6 years ago

Sorry for getting back to you late.

I think the problem should be with the name of the class or the name of the variable that you used as:

This would allow us to use different learning rate for each part of the whole model.

I still cannot find which part of your code cause this problem. I recommend you to try to run my code with the previous version of Tensorflow. You can create another Python virtual environment (e.g., using Miniconda2), and then install the required packages with the same version mentioned in the README. Then print out these train_vars1 and train_vars2. I believe you would be able to identify where is the problem.

Hope this help.