Skip to content

getting dimension error while running your pretrained model for evaluation #4

@varadbhogayata

Description

@varadbhogayata

Evaluating the model :python main.py --phase=eval --model_file='/media/varad/ESSENTIAL/Varad/STUDY/SEM_8/VQA/Implementation/Part2/visual_question_answering/120999/120999.npy'
/home/varad/anaconda3/envs/py27/lib/python2.7/site-packages/h5py/init.py:36: FutureWarning: Conversion of the second argument of issubdtype from float to np.floating is deprecated. In future, it will be treated as np.float64 == np.dtype(float).type.
from ._conv import register_converters as _register_converters
WARNING:tensorflow:From /home/varad/anaconda3/envs/py27/lib/python2.7/site-packages/tensorflow/contrib/learn/python/learn/datasets/base.py:198: retry (from tensorflow.contrib.learn.python.learn.datasets.base) is deprecated and will be removed in a future version.
Instructions for updating:
Use the retry module or similar alternatives.
2018-04-17 18:10:24.341234: I tensorflow/core/platform/cpu_feature_guard.cc:140] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
2018-04-17 18:10:24.416085: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:898] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2018-04-17 18:10:24.416444: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1344] Found device 0 with properties:
name: GeForce 940MX major: 5 minor: 0 memoryClockRate(GHz): 1.189
pciBusID: 0000:01:00.0
totalMemory: 1.96GiB freeMemory: 1.73GiB
2018-04-17 18:10:24.416461: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1423] Adding visible gpu devices: 0
2018-04-17 18:10:24.898355: I tensorflow/core/common_runtime/gpu/gpu_device.cc:911] Device interconnect StreamExecutor with strength 1 edge matrix:
2018-04-17 18:10:24.898382: I tensorflow/core/common_runtime/gpu/gpu_device.cc:917] 0
2018-04-17 18:10:24.898388: I tensorflow/core/common_runtime/gpu/gpu_device.cc:930] 0: N
2018-04-17 18:10:24.898546: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1041] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 1497 MB memory) -> physical GPU (device: 0, name: GeForce 940MX, pci bus id: 0000:01:00.0, compute capability: 5.0)
loading VQA annotations and questions into memory...
0:00:04.244939
creating index...
index created!
Filtering the questions by length...
100%|████████████████████████████████████████████████████████████████████████████████████████████████| 121512/121512 [00:16<00:00, 7572.51it/s]
creating index...
index created!
Filtering the answers by length...
100%|████████████████████████████████████████████████████████████████████████████████████████████████| 121512/121512 [00:15<00:00, 7887.36it/s]
creating index...
index created!
Reading the questions...
Questions read.
Number of questions = 96837
Building the vocabulary...
Vocabulary built.
Number of words = 16077
Processing the questions...
Questions processed.
Building the dataset...
Dataset built.
Building the CNN...
CNN built.
Building the RNN...
RNN built.
Loading the model from /media/varad/ESSENTIAL/Varad/STUDY/SEM_8/VQA/Implementation/Part2/visual_question_answering/120999/120999.npy...
39%|█████████████████████████████████████████▍ | 27/69 [00:11<00:17, 2.38it/s]Traceback (most recent call last):
File "main.py", line 65, in
tf.app.run()
File "/home/varad/anaconda3/envs/py27/lib/python2.7/site-packages/tensorflow/python/platform/app.py", line 126, in run
_sys.exit(main(argv))
File "main.py", line 52, in main
model.load(sess, FLAGS.model_file)
File "/media/varad/ESSENTIAL/Varad/STUDY/SEM_8/VQA/Implementation/Part2/visual_question_answering/base_model.py", line 219, in load
sess.run(v.assign(data_dict[v.name]))
File "/home/varad/anaconda3/envs/py27/lib/python2.7/site-packages/tensorflow/python/ops/variables.py", line 609, in assign
return state_ops.assign(self._variable, value, use_locking=use_locking)
File "/home/varad/anaconda3/envs/py27/lib/python2.7/site-packages/tensorflow/python/ops/state_ops.py", line 281, in assign
validate_shape=validate_shape)
File "/home/varad/anaconda3/envs/py27/lib/python2.7/site-packages/tensorflow/python/ops/gen_state_ops.py", line 61, in assign
use_locking=use_locking, name=name)
File "/home/varad/anaconda3/envs/py27/lib/python2.7/site-packages/tensorflow/python/framework/op_def_library.py", line 787, in _apply_op_helper
op_def=op_def)
File "/home/varad/anaconda3/envs/py27/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 3292, in create_op
compute_device=compute_device)
File "/home/varad/anaconda3/envs/py27/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 3332, in _create_op_helper
set_shapes_for_outputs(op)
File "/home/varad/anaconda3/envs/py27/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 2496, in set_shapes_for_outputs
return _set_shapes_for_outputs(op)
File "/home/varad/anaconda3/envs/py27/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 2469, in _set_shapes_for_outputs
shapes = shape_func(op)
File "/home/varad/anaconda3/envs/py27/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 2399, in call_with_requiring
return call_cpp_shape_fn(op, require_shape_fn=True)
File "/home/varad/anaconda3/envs/py27/lib/python2.7/site-packages/tensorflow/python/framework/common_shapes.py", line 627, in call_cpp_shape_fn
require_shape_fn)
File "/home/varad/anaconda3/envs/py27/lib/python2.7/site-packages/tensorflow/python/framework/common_shapes.py", line 691, in _call_cpp_shape_fn_impl
raise ValueError(err.message)
ValueError: Dimension 0 in both shapes must be equal, but are 16077 and 15317. Shapes are [16077,512] and [15317,512]. for 'Assign_27' (op: 'Assign') with input shapes: [16077,512], [15317,512].

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions