You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Have I written custom code (as opposed to using a stock example script provided in TensorFlow): yes
OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Ubuntu 16.04
TensorFlow installed from (source or binary): binary
TensorFlow version (use command below): 1.5.0
Python version: 3.6
Bazel version (if compiling from source): n/a
GCC/Compiler version (if compiling from source): n/a
CUDA/cuDNN version: 9.0/7.0.5
GPU model and memory:GeForce 950M(4Gb)
Exact command to reproduce:
Describe the problem
I run the function cifar10.maybe_download_and_extract() of tensorflow/models/tutorials/image/cifar10.py file in python command and jupyter notebook .The code runs successfully in python command, but it causes absl.flags._exceptions.UnparsedFlagAccessErrorfrom cifar10.FLAGS.data_dir in jupyter notebook.
The jupyter notebook has already configured the tensorflow kernel, other tensorflow examples could run smoothly on jupyter notebook.
Significant code in cifar10.py file is:
import tensorflow as tf
import cifar10_input
FLAGS = tf.app.flags.FLAGS
# Basic model parameters.
tf.app.flags.DEFINE_integer('batch_size', 128,
"""Number of images to process in a batch.""")
tf.app.flags.DEFINE_string('data_dir', '/tmp/cifar10_data',
"""Path to the CIFAR-10 data directory.""")
tf.app.flags.DEFINE_boolean('use_fp16', False,
"""Train the model using fp16.""")
# .....
def maybe_download_and_extract():
"""Download and extract the tarball from Alex's website."""
dest_directory = FLAGS.data_dir
if not os.path.exists(dest_directory):
os.makedirs(dest_directory)
# ......
The exception happened from the code statement dest_directory = FLAGS.data_dir.
The successful output in python command is as follows:
If that function is something you're meant to run from Python code, it shouldn't be looking at sys.argv. If you're meant to run the example as a script, try using %run .../cifar10.py.
System information
Describe the problem
I run the function
cifar10.maybe_download_and_extract()
oftensorflow/models/tutorials/image/cifar10.py
file in python command and jupyter notebook .The code runs successfully in python command, but it causesabsl.flags._exceptions.UnparsedFlagAccessError
fromcifar10.FLAGS.data_dir
in jupyter notebook.The jupyter notebook has already configured the tensorflow kernel, other tensorflow examples could run smoothly on jupyter notebook.
Significant code in
cifar10.py
file is:The exception happened from the code statement
dest_directory = FLAGS.data_dir
.The successful output in python command is as follows:
The detailed error in jupyter notebook is as follows:
Source code / logs
The text was updated successfully, but these errors were encountered: