DLR-RM / AugmentedAutoencoder

Official Code: Implicit 3D Orientation Learning for 6D Object Detection from RGB Images
MIT License
338 stars 97 forks source link

Invalid argument: input depth must be evenly divisible by filter depth: 3 vs 512 #64

Closed CaptainTimberTim closed 4 years ago

CaptainTimberTim commented 4 years ago

Hi, I have a problem I can't seem to fix. If I try to use more than one AAE for pose detection the second AaE always errors with what I wrote in the title, somewhere deep in tensorflow. It does not seem to be the AAE itself that is problematic if I switch them in experiments from

experiments = ['exp_group/my_autoencoder','exp_group/Septamino_lime_small'] to experiments = ['exp_group/Septamino_lime_small', 'exp_group/my_autoencoder']

it still has an error only if the second one is detected and needs to process_pose. So it seems that the fact that it is the second one is the problem, but how... The data I give the autopose6d function seems correct as well.

This is the position where the error occurs in the code: Rs_est, ts_est = self.all_codebooks[clas_idx].auto_pose6d(self.sess, det_img, box_xywh, self._camK, 1, self.all_train_args[clas_idx], upright=self._upright)

Or am I missing something that I need to do in order to have more than one AAE?

Thanks in advance!

CaptainTimberTim commented 4 years ago

Here the full error message: 2020-01-28 12:53:56.242229: W tensorflow/core/framework/op_kernel.cc:1502] OP_REQUIRES failed at conv_ops.cc:477 : Invalid argument: input depth must be evenly divisible by filter depth: 3 vs 512 Traceback (most recent call last): File "auto_pose/test/aae_retina_single_image_pose_TD.py", line 160, in all_pose_estimates, all_class_idcs = ae_pose_est.process_pose(boxes, label_fixup, image) File "/home/hci/Dokumente/AugmentedAutoencoder-master/auto_pose/test/aae_retina_pose_estimator.py", line 206, in process_pose upright=self._upright) File "/home/hci/.local/lib/python2.7/site-packages/auto_pose/ae/codebook.py", line 77, in auto_pose6d idcs = self.nearest_rotation(session, x, top_n=top_n, upright=upright,return_idcs=True) File "/home/hci/.local/lib/python2.7/site-packages/auto_pose/ae/codebook.py", line 59, in nearest_rotation cosine_similarity = session.run(self.cos_similarity, {self._encoder.x: x}) File "/media/hci/DataStorage/VirtualEnv_TensorflowGPU/venv/local/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 950, in run run_metadata_ptr) File "/media/hci/DataStorage/VirtualEnv_TensorflowGPU/venv/local/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 1173, in _run feed_dict_tensor, options, run_metadata) File "/media/hci/DataStorage/VirtualEnv_TensorflowGPU/venv/local/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 1350, in _do_run run_metadata) File "/media/hci/DataStorage/VirtualEnv_TensorflowGPU/venv/local/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 1370, in _do_call raise type(e)(node_def, op, message) tensorflow.python.framework.errors_impl.InvalidArgumentError: 2 root error(s) found. (0) Invalid argument: input depth must be evenly divisible by filter depth: 3 vs 512 [[node Septamino_lime_small/conv2d_4/Conv2D (defined at /home/hci/.local/lib/python2.7/site-packages/auto_pose/ae/encoder.py:49) ]] [[Septamino_lime_small/MatMul/_2035]] (1) Invalid argument: input depth must be evenly divisible by filter depth: 3 vs 512 [[node Septamino_lime_small/conv2d_4/Conv2D (defined at /home/hci/.local/lib/python2.7/site-packages/auto_pose/ae/encoder.py:49) ]] 0 successful operations. 0 derived errors ignored.

Errors may have originated from an input operation. Input Source operations connected to node Septamino_lime_small/conv2d_4/Conv2D: Septamino_lime_small/Placeholder (defined at /home/hci/.local/lib/python2.7/site-packages/auto_pose/ae/ae_factory.py:122)

Input Source operations connected to node Septamino_lime_small/conv2d_4/Conv2D: Septamino_lime_small/Placeholder (defined at /home/hci/.local/lib/python2.7/site-packages/auto_pose/ae/ae_factory.py:122)

Original stack trace for u'Septamino_lime_small/conv2d_4/Conv2D': File "auto_pose/test/aae_retina_single_image_pose_TD.py", line 87, in ae_pose_est = AePoseEstimator(test_configpath) File "/home/hci/Dokumente/AugmentedAutoencoder-master/auto_pose/test/aae_retina_pose_estimator.py", line 85, in init self.all_codebooks.append(factory.build_codebook_from_name(experiment_name, experiment_group, return_dataset=False)) File "/home/hci/.local/lib/python2.7/site-packages/auto_pose/ae/ae_factory.py", line 123, in build_codebook_from_name encoder = build_encoder(x, args) File "/home/hci/.local/lib/python2.7/site-packages/auto_pose/ae/ae_factory.py", line 46, in build_encoder is_training=is_training File "/home/hci/.local/lib/python2.7/site-packages/auto_pose/ae/encoder.py", line 18, in init self.encoder_out File "/home/hci/.local/lib/python2.7/site-packages/auto_pose/ae/utils.py", line 15, in decorator setattr(self, attribute, function(self)) File "/home/hci/.local/lib/python2.7/site-packages/auto_pose/ae/encoder.py", line 49, in encoder_out )(inputs=x) File "/media/hci/DataStorage/VirtualEnv_TensorflowGPU/venv/local/lib/python2.7/site-packages/tensorflow/python/keras/engine/base_layer.py", line 634, in call outputs = call_fn(inputs, *args, *kwargs) File "/media/hci/DataStorage/VirtualEnv_TensorflowGPU/venv/local/lib/python2.7/site-packages/tensorflow/python/keras/layers/convolutional.py", line 196, in call outputs = self._convolution_op(inputs, self.kernel) File "/media/hci/DataStorage/VirtualEnv_TensorflowGPU/venv/local/lib/python2.7/site-packages/tensorflow/python/ops/nn_ops.py", line 1079, in call return self.conv_op(inp, filter) File "/media/hci/DataStorage/VirtualEnv_TensorflowGPU/venv/local/lib/python2.7/site-packages/tensorflow/python/ops/nn_ops.py", line 635, in call return self.call(inp, filter) File "/media/hci/DataStorage/VirtualEnv_TensorflowGPU/venv/local/lib/python2.7/site-packages/tensorflow/python/ops/nn_ops.py", line 234, in call name=self.name) File "/media/hci/DataStorage/VirtualEnv_TensorflowGPU/venv/local/lib/python2.7/site-packages/tensorflow/python/ops/nn_ops.py", line 1953, in conv2d name=name) File "/media/hci/DataStorage/VirtualEnv_TensorflowGPU/venv/local/lib/python2.7/site-packages/tensorflow/python/ops/gen_nn_ops.py", line 1071, in conv2d data_format=data_format, dilations=dilations, name=name) File "/media/hci/DataStorage/VirtualEnv_TensorflowGPU/venv/local/lib/python2.7/site-packages/tensorflow/python/framework/op_def_library.py", line 788, in _apply_op_helper op_def=op_def) File "/media/hci/DataStorage/VirtualEnv_TensorflowGPU/venv/local/lib/python2.7/site-packages/tensorflow/python/util/deprecation.py", line 507, in new_func return func(args, **kwargs) File "/media/hci/DataStorage/VirtualEnv_TensorflowGPU/venv/local/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 3616, in create_op op_def=op_def) File "/media/hci/DataStorage/VirtualEnv_TensorflowGPU/venv/local/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 2005, in init self._traceback = tf_stack.extract_stack()

MartinSmeyer commented 4 years ago

same as #66