Tensorflow ArgumentError Running CIFAR-10 example

2024/10/13 21:17:02

I am trying to run the CIFAR-10 example of Tensorflow. However when executing python cifar10.py I am getting the error attached below.

I have installed Version 0.6.0 of the Tensorflow package using pip. The framework is working fine on other models including the MNIST tutorial and some self developed networks. Does anybody has an idea about the origin of the problem? Do you think I should open an issue on github?

I tensorflow/stream_executor/dso_loader.cc:101] successfully opened CUDA library libcublas.so.7.0 locally
I tensorflow/stream_executor/dso_loader.cc:101] successfully opened CUDA library libcudnn.so.6.5 locally
I tensorflow/stream_executor/dso_loader.cc:101] successfully opened CUDA library libcufft.so.7.0 locally
I tensorflow/stream_executor/dso_loader.cc:101] successfully opened CUDA library libcuda.so locally
I tensorflow/stream_executor/dso_loader.cc:101] successfully opened CUDA library libcurand.so.7.0 locally
Traceback (most recent call last):File "cifar10.py", line 54, in <module>"""Number of images to process in a batch.""")File "/disk/no_backup/teichman/tensorflow/gpu_mode/local/lib/python2.7/site-packages/tensorflow/python/platform/default/_flags.py", line 86, in DEFINE_integer_define_helper(flag_name, default_value, docstring, int)File "/disk/no_backup/teichman/tensorflow/gpu_mode/local/lib/python2.7/site-packages/tensorflow/python/platform/default/_flags.py", line 60, in _define_helpertype=flagtype)File "/usr/lib/python2.7/argparse.py", line 1297, in add_argumentreturn self._add_action(action)File "/usr/lib/python2.7/argparse.py", line 1671, in _add_actionself._optionals._add_action(action)File "/usr/lib/python2.7/argparse.py", line 1498, in _add_actionaction = super(_ArgumentGroup, self)._add_action(action)File "/usr/lib/python2.7/argparse.py", line 1311, in _add_actionself._check_conflict(action)File "/usr/lib/python2.7/argparse.py", line 1449, in _check_conflictconflict_handler(action, confl_optionals)File "/usr/lib/python2.7/argparse.py", line 1456, in _handle_conflict_errorraise ArgumentError(action, message % conflict_string)
argparse.ArgumentError: argument --batch_size: conflicting option string(s): --batch_size
Answer

Solved the problem. One is not supposed to execute python cifar10.py directly, but one should run python cifar10_train.py or python cifar10_eval.py instead.

https://en.xdnf.cn/q/69486.html

Related Q&A

How to plot multiple density plots on the same figure in python

I know this is going to end up being a really messy plot, but I am curious to know what the most efficient way to do this is. I have some data that looks like this in a csv file:ROI Band Min…

Running Tkinter on Mac

I am an absolute newbie. Im trying to make Python GUI for my school project so I decided to use Tkinter. When I try to import Tkinter it throws this message: >>> import tkinter Traceback (most…

Object-based default value in SQLAlchemy declarative

With SQLAlchemy, it is possible to add a default value to every function. As I understand it, this may also be a callable (either without any arguments or with an optional ExecutionContext argument).No…

High Resolution Image of a Graph using NetworkX and Matplotlib

I have a python code to generate a random graph of 300 nodes and 200 edges and display itimport networkx as nx import matplotlib.pyplot as pltG = nx.gnm_random_graph(300,200) graph_pos = nx.spring_layo…

how to read an outputted fortran binary NxNxN matrix into Python

I wrote out a matrix in Fortran as follows:real(kind=kind(0.0d0)), dimension(256,256,256) :: dense[...CALCULATION...]inquire(iolength=reclen)dense open(unit=8,file=fname,& form=unformatted,access=d…

python argparse subcommand with dependency and conflict

I want to use argparse to build a tool with subcommand. The possible syntax could be/tool.py download --from 1234 --interval 60 /tool.py download --build 1432 /tool.py clean --numbers 10So I want to us…

Running django project without django installation

I have developed a project with Django framework(python and mysql DB) in Linux OS(Ubuntu 12.04), I want to run this project in localhost in another machine with Linux(Ubuntu 12.04) without installing D…

redefine __and__ operator

Why I cant redefine the __and__ operator?class Cut(object):def __init__(self, cut):self.cut = cutdef __and__(self, other):return Cut("(" + self.cut + ") && (" + other.cut +…

How to find class of bound method during class construction in Python 3.1?

i want to write a decorator that enables methods of classes to become visible to other parties; the problem i am describing is, however, independent of that detail. the code will look roughly like this…

Multi-Threaded NLP with Spacy pipe

Im trying to apply Spacy NLP (Natural Language Processing) pipline to a big text file like Wikipedia Dump. Here is my code based on Spacys documentation example:from spacy.en import Englishinput = open…