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

yolov5:Dimensions of inputs should match #11

Open
jttqbc666 opened this issue Oct 16, 2020 · 4 comments
Open

yolov5:Dimensions of inputs should match #11

jttqbc666 opened this issue Oct 16, 2020 · 4 comments

Comments

@jttqbc666
Copy link

Instructions for updating:
Use Variable.read_value. Variables in 2.X are initialized automatically both in eager and graph (inside tf.defun) contexts.
0%| | 0/1804 [00:00<?, ?it/s]=> Restoring weights from: ckpts/yolov5_test-loss=10.0817.ckpt-125 ...
=> ckpts/yolov5_test-loss=10.0817.ckpt-125 does not exist !!!
=> Now it starts to train YOLO-yolov5 from scratch ...
0%| | 0/1804 [00:11<?, ?it/s]
Traceback (most recent call last):

File "D:\ruanjian\anaconda\envs\tf1\lib\site-packages\tensorflow\python\client\session.py", line 1365, in _do_call
return fn(*args)

File "D:\ruanjian\anaconda\envs\tf1\lib\site-packages\tensorflow\python\client\session.py", line 1350, in _run_fn
target_list, run_metadata)

File "D:\ruanjian\anaconda\envs\tf1\lib\site-packages\tensorflow\python\client\session.py", line 1443, in _call_tf_sessionrun
run_metadata)

InvalidArgumentError: 2 root error(s) found.
(0) Invalid argument: ConcatOp : Dimensions of inputs should match: shape[0] = [2,44,44,384] vs. shape[1] = [2,22,22,384]
[[{{node define_loss/route_0/concat}}]]
[[define_loss/iou_loss/add_1/_209]]
(1) Invalid argument: ConcatOp : Dimensions of inputs should match: shape[0] = [2,44,44,384] vs. shape[1] = [2,22,22,384]
[[{{node define_loss/route_0/concat}}]]
0 successful operations.
0 derived errors ignored.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File "", line 261, in
YoloTrain(net_type).train()

File "", line 207, in train
self.trainable: True,})

File "D:\ruanjian\anaconda\envs\tf1\lib\site-packages\tensorflow\python\client\session.py", line 958, in run
run_metadata_ptr)

File "D:\ruanjian\anaconda\envs\tf1\lib\site-packages\tensorflow\python\client\session.py", line 1181, in _run
feed_dict_tensor, options, run_metadata)

File "D:\ruanjian\anaconda\envs\tf1\lib\site-packages\tensorflow\python\client\session.py", line 1359, in _do_run
run_metadata)

File "D:\ruanjian\anaconda\envs\tf1\lib\site-packages\tensorflow\python\client\session.py", line 1384, in _do_call
raise type(e)(node_def, op, message)

InvalidArgumentError: 2 root error(s) found.
(0) Invalid argument: ConcatOp : Dimensions of inputs should match: shape[0] = [2,44,44,384] vs. shape[1] = [2,22,22,384]
[[node define_loss/route_0/concat (defined at D:\Artificial_Intelligence\anaconda_spyder\Yolov5_tf-master\core\yolov5.py:215) ]]
[[define_loss/iou_loss/add_1/_209]]
(1) Invalid argument: ConcatOp : Dimensions of inputs should match: shape[0] = [2,44,44,384] vs. shape[1] = [2,22,22,384]
[[node define_loss/route_0/concat (defined at D:\Artificial_Intelligence\anaconda_spyder\Yolov5_tf-master\core\yolov5.py:215) ]]
0 successful operations.
0 derived errors ignored.

Errors may have originated from an input operation.
Input Source operations connected to node define_loss/route_0/concat:
define_loss/route_0/conv_route_0/LeakyRelu (defined at D:\Artificial_Intelligence\anaconda_spyder\Yolov5_tf-master\core\yolov5.py:55)
define_loss/upsample0/ResizeNearestNeighbor (defined at D:\Artificial_Intelligence\anaconda_spyder\Yolov5_tf-master\core\yolov5.py:75)

Input Source operations connected to node define_loss/route_0/concat:
define_loss/route_0/conv_route_0/LeakyRelu (defined at D:\Artificial_Intelligence\anaconda_spyder\Yolov5_tf-master\core\yolov5.py:55)
define_loss/upsample0/ResizeNearestNeighbor (defined at D:\Artificial_Intelligence\anaconda_spyder\Yolov5_tf-master\core\yolov5.py:75)

Original stack trace for 'define_loss/route_0/concat':
File "D:\ruanjian\anaconda\envs\tf1\lib\runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "D:\ruanjian\anaconda\envs\tf1\lib\runpy.py", line 85, in run_code
exec(code, run_globals)
File "D:\ruanjian\anaconda\envs\tf1\lib\site-packages\spyder_kernels\console_main
.py", line 11, in
start.main()
File "D:\ruanjian\anaconda\envs\tf1\lib\site-packages\spyder_kernels\console\start.py", line 318, in main
kernel.start()
File "D:\ruanjian\anaconda\envs\tf1\lib\site-packages\ipykernel\kernelapp.py", line 583, in start
self.io_loop.start()
File "D:\ruanjian\anaconda\envs\tf1\lib\site-packages\tornado\platform\asyncio.py", line 149, in start
self.asyncio_loop.run_forever()
File "D:\ruanjian\anaconda\envs\tf1\lib\asyncio\base_events.py", line 442, in run_forever
self._run_once()
File "D:\ruanjian\anaconda\envs\tf1\lib\asyncio\base_events.py", line 1462, in _run_once
handle._run()
File "D:\ruanjian\anaconda\envs\tf1\lib\asyncio\events.py", line 145, in _run
self._callback(*self._args)
File "D:\ruanjian\anaconda\envs\tf1\lib\site-packages\tornado\ioloop.py", line 690, in
lambda f: self._run_callback(functools.partial(callback, future))
File "D:\ruanjian\anaconda\envs\tf1\lib\site-packages\tornado\ioloop.py", line 743, in _run_callback
ret = callback()
File "D:\ruanjian\anaconda\envs\tf1\lib\site-packages\tornado\gen.py", line 787, in inner
self.run()
File "D:\ruanjian\anaconda\envs\tf1\lib\site-packages\tornado\gen.py", line 748, in run
yielded = self.gen.send(value)
File "D:\ruanjian\anaconda\envs\tf1\lib\site-packages\ipykernel\kernelbase.py", line 361, in process_one
yield gen.maybe_future(dispatch(*args))
File "D:\ruanjian\anaconda\envs\tf1\lib\site-packages\tornado\gen.py", line 209, in wrapper
yielded = next(result)
File "D:\ruanjian\anaconda\envs\tf1\lib\site-packages\ipykernel\kernelbase.py", line 268, in dispatch_shell
yield gen.maybe_future(handler(stream, idents, msg))
File "D:\ruanjian\anaconda\envs\tf1\lib\site-packages\tornado\gen.py", line 209, in wrapper
yielded = next(result)
File "D:\ruanjian\anaconda\envs\tf1\lib\site-packages\ipykernel\kernelbase.py", line 541, in execute_request
user_expressions, allow_stdin,
File "D:\ruanjian\anaconda\envs\tf1\lib\site-packages\tornado\gen.py", line 209, in wrapper
yielded = next(result)
File "D:\ruanjian\anaconda\envs\tf1\lib\site-packages\ipykernel\ipkernel.py", line 300, in do_execute
res = shell.run_cell(code, store_history=store_history, silent=silent)
File "D:\ruanjian\anaconda\envs\tf1\lib\site-packages\ipykernel\zmqshell.py", line 536, in run_cell
return super(ZMQInteractiveShell, self).run_cell(*args, **kwargs)
File "D:\ruanjian\anaconda\envs\tf1\lib\site-packages\IPython\core\interactiveshell.py", line 2858, in run_cell
raw_cell, store_history, silent, shell_futures)
File "D:\ruanjian\anaconda\envs\tf1\lib\site-packages\IPython\core\interactiveshell.py", line 2886, in _run_cell
return runner(coro)
File "D:\ruanjian\anaconda\envs\tf1\lib\site-packages\IPython\core\async_helpers.py", line 68, in pseudo_sync_runner
coro.send(None)
File "D:\ruanjian\anaconda\envs\tf1\lib\site-packages\IPython\core\interactiveshell.py", line 3063, in run_cell_async
interactivity=interactivity, compiler=compiler, result=result)
File "D:\ruanjian\anaconda\envs\tf1\lib\site-packages\IPython\core\interactiveshell.py", line 3254, in run_ast_nodes
if (await self.run_code(code, result, async
=asy)):
File "D:\ruanjian\anaconda\envs\tf1\lib\site-packages\IPython\core\interactiveshell.py", line 3331, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "", line 261, in
YoloTrain(net_type).train()
File "", line 105, in init
self.model = YOLOV5(self.input_data, self.trainable)
File "D:\Artificial_Intelligence\anaconda_spyder\Yolov5_tf-master\core\yolov5.py", line 176, in init
self.conv_lbbox, self.conv_mbbox, self.conv_sbbox = self.__build_network(input_data)
File "D:\Artificial_Intelligence\anaconda_spyder\Yolov5_tf-master\core\yolov5.py", line 215, in __build_network
y38 = tf.concat([y38, y19_upsample], axis=-1)
File "D:\ruanjian\anaconda\envs\tf1\lib\site-packages\tensorflow\python\util\dispatch.py", line 180, in wrapper
return target(*args, **kwargs)
File "D:\ruanjian\anaconda\envs\tf1\lib\site-packages\tensorflow\python\ops\array_ops.py", line 1606, in concat
return gen_array_ops.concat_v2(values=values, axis=axis, name=name)
File "D:\ruanjian\anaconda\envs\tf1\lib\site-packages\tensorflow\python\ops\gen_array_ops.py", line 1189, in concat_v2
"ConcatV2", values=values, axis=axis, name=name)
File "D:\ruanjian\anaconda\envs\tf1\lib\site-packages\tensorflow\python\framework\op_def_library.py", line 744, in _apply_op_helper
attrs=attr_protos, op_def=op_def)
File "D:\ruanjian\anaconda\envs\tf1\lib\site-packages\tensorflow\python\framework\ops.py", line 3327, in _create_op_internal
op_def=op_def)
File "D:\ruanjian\anaconda\envs\tf1\lib\site-packages\tensorflow\python\framework\ops.py", line 1791, in init
self._traceback = tf_stack.extract_stack()

@avBuffer
Copy link
Owner

Hey jttqbc666, Thanks, could you mind telling which net type selecting on backbone, such as darknet53 or mobilenet?

@Crystalxd
Copy link

Crystalxd commented Dec 21, 2020

I have the same problem, I used the 'darknet53' net_tpye to train yolov5s.

@payal211
Copy link

payal211 commented May 3, 2021

Hello @avBuffer @Crystalxd,
Have you solved it?
I have the same issue. I too used “darknet53” and net_type yolov5.

can you please update ASAP?
Thanks in advance.

@wafa-bouzouita
Copy link

Hello,
I have the same issue.
can you please update ?
Thank you

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

5 participants