google-research / simclr

SimCLRv2 - Big Self-Supervised Models are Strong Semi-Supervised Learners
https://arxiv.org/abs/2006.10029
Apache License 2.0
4.11k stars 626 forks source link

finetuning notebook runtime error #65

Closed sp7412 closed 4 years ago

sp7412 commented 4 years ago

I just clicked on the "open in colab" link (https://colab.research.google.com/github/google-research/simclr/blob/master/colabs/finetuning.ipynb)

I made no changes to the notebook. My runtime type is set to GPU

I clicked Runtime-> Run all but I get this error:

`INFO:tensorflow:Saver not created because there are no variables in the graph to restore INFO:tensorflow:Saver not created because there are no variables in the graph to restore

ValueError Traceback (most recent call last)

in () 25 train_op = optimizer.minimize( 26 loss_t, global_step=tf.train.get_or_create_global_step(), ---> 27 var_list=variables_to_train) 28 29 print('Variables to train:', variables_to_train) 6 frames /usr/local/lib/python3.6/dist-packages/tensorflow/python/ops/variable_scope.py in _get_single_variable(self, name, shape, dtype, initializer, regularizer, partition_info, reuse, trainable, collections, caching_device, validate_shape, use_resource, constraint, synchronization, aggregation) 860 # ResourceVariables don't have an op associated with so no traceback 861 if isinstance(var, resource_variable_ops.ResourceVariable): --> 862 raise ValueError(err_msg) 863 tb = var.op.traceback[::-1] 864 # Throw away internal tf entries and only take a few lines. In some ValueError: Variable head_supervised_new/dense/kernel/Momentum already exists, disallowed. Did you mean to set reuse=True or reuse=tf.AUTO_REUSE in VarScope?`
chentingpc commented 4 years ago

You probably have run it before. So use "Restart and run all" instead?