tensorflow / tensorflow/models

Variable reuse issue with wide resnet model training script in autoaugment/train_cifar.py

Open
#8,899 1 comment 0 reactions 1 assignee View on GitHub

@BarretZoph is already working on this.

Since Jul 20, 2020.

models:research type:bug
Dominant language
Python
Stars
77.7k
Forks
44.8k
PR merge metrics
No merged PRs in 30d

Description

I am trying to train a wide resnet model for CIFAR10 using the models/research/autoaugment/train_cifar.py directory. I just copied over all the necessary files to train a CIFAR10 model and created a local repository. Since this requires Python 2 and Tensorflow 1, I am running the code with tensorflow 1.15 and python 2.7.6. I am using MacOS and CPU.

To train a wrn model, I run the following (I haven't modified the original code):

python train_cifar.py --model_name=wrn \
                      --checkpoint_dir=training \
                      --data_path=data \
                      --dataset='cifar10' \
                      --use_cpu=1

However, when I run this, I get the following error:
ValueError: Variable model/init/init_conv/weights already exists, disallowed. Did you mean to set reuse=True or reuse=tf.AUTO_REUSE in VarScope?

I've included screenshots so you can see the entire traceback. The issue appears to be with custom_ops.py and reusing variables. I am not super familiar with tensorflow and gravitate towards use keras, so I'm not sure how to fix this issue and where any changes should be made. Thank you!

Screen Shot 2020-07-17 at 10 52 02 AM Screen Shot 2020-07-17 at 10 52 12 AM

Also, this is my first time submitting an issue so apologies if I did not follow the guidelines completely and would welcome any feedback. I did not see any other issues filed about variable reuse for the cifar10/wide resnet training script.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.