Skip to content
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

Error while training #2

Open
mry94 opened this issue Nov 4, 2017 · 3 comments
Open

Error while training #2

mry94 opened this issue Nov 4, 2017 · 3 comments

Comments

@mry94
Copy link

mry94 commented Nov 4, 2017

Hi,

I'm getting this error when I'm trying to run the code:
Tensorflow version :1.3.0
installed via Anaconda

Traceback (most recent call last):
File "main.py", line 39, in
tf.app.run()
File "/storage/work/anaconda2/envs/tensorflow-gpu/lib/python2.7/site-packages/tensorflow/python/platform/app.py", line 48, in run
_sys.exit(main(_sys.argv[:1] + flags_passthrough))
File "main.py", line 35, in main
evaluate_addition()
File "/storage/workNPI/npi/tasks/addition/eval.py", line 32, in evaluate_addition
core = AdditionCore()
File "/storage/work/NPI/npi/tasks/addition/addition.py", line 38, in init
self.program_embedding = self.build_program_store()
File "/storage/work/NPI/npi/tasks/addition/addition.py", line 65, in build_program_store
CONFIG["PROGRAM_EMBEDDING_SIZE"], name="Program_Embedding")
File "/storage/work/anaconda2/envs/tensorflow-gpu/lib/python2.7/site-packages/tflearn/layers/embedding_ops.py", line 70, in embedding
inference.seq_length = retrieve_seq_length_op(tf.reshape(incoming, shape))
File "/storage/work/anaconda2/envs/tensorflow-gpu/lib/python2.7/site-packages/tensorflow/python/ops/gen_array_ops.py", line 2619, in reshape
name=name)
File "/storage/work/anaconda2/envs/tensorflow-gpu/lib/python2.7/site-packages/tensorflow/python/framework/op_def_library.py", line 767, in apply_op
op_def=op_def)
File "/storage/work/anaconda2/envs/tensorflow-gpu/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 2632, in create_op
set_shapes_for_outputs(ret)
File "/storage/work/anaconda2/envs/tensorflow-gpu/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 1911, in set_shapes_for_outputs
shapes = shape_func(op)
File "/storage/work/anaconda2/envs/tensorflow-gpu/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 1861, in call_with_requiring
return call_cpp_shape_fn(op, require_shape_fn=True)
File "/storage/work/anaconda2/envs/tensorflow-gpu/lib/python2.7/site-packages/tensorflow/python/framework/common_shapes.py", line 595, in call_cpp_shape_fn
require_shape_fn)
File "/storage/work/anaconda2/envs/tensorflow-gpu/lib/python2.7/site-packages/tensorflow/python/framework/common_shapes.py", line 659, in _call_cpp_shape_fn_impl
raise ValueError(err.message)
ValueError: Dimension size must be evenly divisible by 10 but is 1 for 'Reshape' (op: 'Reshape') with input shapes: [1,1], [4] and with input tensors computed as partial shapes: input[1] = [?,1,10,1].

Any idea how to solve this?
Thanks,

@PlanetMoon
Copy link

The same question.

Traceback (most recent call last):
File "main.py", line 39, in
tf.app.run()
File "/home/luna/ml/env/lib/python3.6/site-packages/tensorflow/python/platform/app.py", line 48, in run
_sys.exit(main(_sys.argv[:1] + flags_passthrough))
File "main.py", line 35, in main
evaluate_addition()
File "/home/luna/ml/npi/tasks/addition/eval.py", line 32, in evaluate_addition
core = AdditionCore()
File "/home/luna/ml/npi/tasks/addition/addition.py", line 38, in init
self.program_embedding = self.build_program_store()
File "/home/luna/ml/npi/tasks/addition/addition.py", line 65, in build_program_store
CONFIG["PROGRAM_EMBEDDING_SIZE"], name="Program_Embedding")
File "/home/luna/ml/env/lib/python3.6/site-packages/tflearn/layers/embedding_ops.py", line 70, in embedding
inference.seq_length = retrieve_seq_length_op(tf.reshape(incoming, shape))
File "/home/luna/ml/env/lib/python3.6/site-packages/tensorflow/python/ops/gen_array_ops.py", line 3938, in reshape
"Reshape", tensor=tensor, shape=shape, name=name)
File "/home/luna/ml/env/lib/python3.6/site-packages/tensorflow/python/framework/op_def_library.py", line 787, in _apply_op_helper
op_def=op_def)
File "/home/luna/ml/env/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 2958, in create_op
set_shapes_for_outputs(ret)
File "/home/luna/ml/env/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 2209, in set_shapes_for_outputs
shapes = shape_func(op)
File "/home/luna/ml/env/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 2159, in call_with_requiring
return call_cpp_shape_fn(op, require_shape_fn=True)
File "/home/luna/ml/env/lib/python3.6/site-packages/tensorflow/python/framework/common_shapes.py", line 627, in call_cpp_shape_fn
require_shape_fn)
File "/home/luna/ml/env/lib/python3.6/site-packages/tensorflow/python/framework/common_shapes.py", line 691, in _call_cpp_shape_fn_impl
raise ValueError(err.message)
ValueError: Dimension size must be evenly divisible by 10 but is 1 for 'Reshape' (op: 'Reshape') with input shapes: [1,1], [4] and with input tensors computed as partial shapes: input[1] = [?,1,10,1].

Maybe the code is out of date?

@ralphatobe
Copy link

It appears I have joined the club. Has anyone found a solution/workaround?

Traceback (most recent call last):
File "main.py", line 39, in
tf.app.run()
File "/home/rburke45/npi/local/lib/python2.7/site-packages/tensorflow/python/platform/app.py", line 48, in run
_sys.exit(main(_sys.argv[:1] + flags_passthrough))
File "main.py", line 31, in main
train_addition(FLAGS.num_epochs)
File "/home/rburke45/Documents/Program Synthesis/Neural Program Recursion/npi/tasks/addition/train.py", line 33, in train_addition
core = AdditionCore()
File "/home/rburke45/Documents/Program Synthesis/Neural Program Recursion/npi/tasks/addition/addition.py", line 38, in init
self.program_embedding = self.build_program_store()
File "/home/rburke45/Documents/Program Synthesis/Neural Program Recursion/npi/tasks/addition/addition.py", line 68, in build_program_store
CONFIG["PROGRAM_EMBEDDING_SIZE"], name="Program_Embedding")
File "/home/rburke45/npi/local/lib/python2.7/site-packages/tflearn/layers/embedding_ops.py", line 70, in embedding
inference.seq_length = retrieve_seq_length_op(tf.reshape(incoming, shape))
File "/home/rburke45/npi/local/lib/python2.7/site-packages/tensorflow/python/ops/gen_array_ops.py", line 2510, in reshape
name=name)
File "/home/rburke45/npi/local/lib/python2.7/site-packages/tensorflow/python/framework/op_def_library.py", line 768, in apply_op
op_def=op_def)
File "/home/rburke45/npi/local/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 2338, in create_op
set_shapes_for_outputs(ret)
File "/home/rburke45/npi/local/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 1719, in set_shapes_for_outputs
shapes = shape_func(op)
File "/home/rburke45/npi/local/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 1669, in call_with_requiring
return call_cpp_shape_fn(op, require_shape_fn=True)
File "/home/rburke45/npi/local/lib/python2.7/site-packages/tensorflow/python/framework/common_shapes.py", line 610, in call_cpp_shape_fn
debug_python_shape_fn, require_shape_fn)
File "/home/rburke45/npi/local/lib/python2.7/site-packages/tensorflow/python/framework/common_shapes.py", line 676, in _call_cpp_shape_fn_impl
raise ValueError(err.message)
ValueError: Dimension size must be evenly divisible by 10 but is 1 for 'Reshape' (op: 'Reshape') with input shapes: [1,1], [4] and with input tensors computed as partial shapes: input[1] = [?,1,10,1].

@ralphatobe
Copy link

If anyone continues to have this problem I've updated this repo to TF 1.13 and removed dependency on the tflearn package. @siddk, you're currently attributed in the README, where I link back to this original repo. If you'd like me to expand that attribution to individual files, feel free to contact me.

new repo: https://github.com/ford-core-ai/neural-programmer-interpreter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants