-
Notifications
You must be signed in to change notification settings - Fork 45.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ValueError: The first layer in a Sequential model must get an input_shape
argument.
#4104
Comments
Hmmm I'm not running into this error. What version of tensorflow are you running? |
I checked my tensorflow version and it is 1.4.0. I am running this on a macbook os system and have already set the paths and dependencies. |
In that case, please check out the r1.4.0 branch or release. The master version is updated to work with the Tensorflow nightly build. |
Thank you so much, that solved the problem |
* 'master' of https://github.com/tensorflow/models: (404 commits) official/mnist: Updates with the release of TensorFlow 1.8. Internal changes to slim and object detection (tensorflow#4100) catch cpuinfo ImportError (tensorflow#4138) [samples/core/get_starter/eager]: Update with API simplifications in 1.8 Add vincentvanhoucke as owner for research/marco Add marco subdirectory to README.md Create request.json Create jpeg2json.py Fix width / height. Create README.md Add new import paths to mnist_tpu.py (tensorflow#4133) fix model call (tensorflow#4132) Remove useless fields in resnet_model (tensorflow#4110) official/mnist: Add input_shape parameter to initial layer (tensorflow#4104) (tensorflow#4118) Increase minimum TF version for DEFINE_enum and rename variable mappings for change to RNN variable names. (tensorflow#4123) fix import errors Minor update the resnet runloop. (tensorflow#4113) Two new plot-generating scripts and changes in support of the ICLR poster. (tensorflow#4092) Add export savedmodel to wide_deep (tensorflow#4041) Fix 2 typos ...
hi, i have this problem with version 1.8 |
Fix is merged into master and later to r1.9.0. |
@leccyril Have you tried switching to r1.9.0 or master, and has it worked? |
I also get this problem, running tensorflow 1.5. on macOS Mojave |
Hi There, |
When running the officials/mnist/mnist.py there is an error message:
Traceback (most recent call last):
File "mnist.py", line 261, in
main(argv=sys.argv)
File "mnist.py", line 225, in main
mnist_classifier.train(input_fn=train_input_fn, hooks=train_hooks)
File "/Users/yangsong/tensorflow/lib/python3.5/site-packages/tensorflow/python/estimator/estimator.py", line 355, in train
loss = self._train_model(input_fn, hooks, saving_listeners)
File "/Users/yangsong/tensorflow/lib/python3.5/site-packages/tensorflow/python/estimator/estimator.py", line 824, in _train_model
features, labels, model_fn_lib.ModeKeys.TRAIN, self.config)
File "/Users/yangsong/tensorflow/lib/python3.5/site-packages/tensorflow/python/estimator/estimator.py", line 805, in _call_model_fn
model_fn_results = self._model_fn(features=features, **kwargs)
File "mnist.py", line 89, in model_fn
model = create_model(params['data_format'])
File "mnist.py", line 83, in create_model
l.Dense(10)
File "/Users/yangsong/tensorflow/lib/python3.5/site-packages/tensorflow/python/keras/_impl/keras/engine/sequential.py", line 120, in init
self.add(layer)
File "/Users/yangsong/tensorflow/lib/python3.5/site-packages/tensorflow/python/keras/_impl/keras/engine/sequential.py", line 163, in add
raise ValueError('The first layer in a '
ValueError: The first layer in a Sequential model must get an
input_shape
argument.Please go to Stack Overflow for help and support:
http://stackoverflow.com/questions/tagged/tensorflow
Also, please understand that many of the models included in this repository are experimental and research-style code. If you open a GitHub issue, here is our policy:
Here's why we have that policy: TensorFlow developers respond to issues. We want to focus on work that benefits the whole community, e.g., fixing bugs and adding features. Support only helps individuals. GitHub also notifies thousands of people when issues are filed. We want them to see you communicating an interesting problem, rather than being redirected to Stack Overflow.
System information
You can collect some of this information using our environment capture script:
https://github.com/tensorflow/tensorflow/tree/master/tools/tf_env_collect.sh
You can obtain the TensorFlow version with
python -c "import tensorflow as tf; print(tf.GIT_VERSION, tf.VERSION)"
Describe the problem
Describe the problem clearly here. Be sure to convey here why it's a bug in TensorFlow or a feature request.
Source code / logs
Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached. Try to provide a reproducible test case that is the bare minimum necessary to generate the problem.
The text was updated successfully, but these errors were encountered: