happylun / SketchModeling

Source code for the Sketch Modeling project: reconstruct a 3D shape from line drawing sketches.
https://people.cs.umass.edu/~zlun/papers/SketchModeling/
GNU General Public License v3.0
142 stars 49 forks source link

Error using 3 points of view #3

Closed felipecadar closed 6 years ago

felipecadar commented 6 years ago

I have an sketch with 3 points of view... so i used --sketch_views SFT to use all of them, but i end up with this error

InvalidArgumentError (see above for traceback): Assign requires shapes of both tensors to match. lhs shape= [4,4,6,64] rhs shape= [4,4,4,64]
     [[Node: save/Assign_393 = Assign[T=DT_FLOAT, _class=["loc:@monnet/G_net/e1/weights"], use_locking=true, validate_shape=true, _device="/job:localhost/replica:0/task:0/device:CPU:0"](monnet/G_net/e1/weights, save/RestoreV2:393)]]

Do i have to train the MonterNet again to use 3 points of view ?

Full traceback:

start running...
Loading testing data...
Building network...
2018-06-04 10:00:04.261194: I tensorflow/core/platform/cpu_feature_guard.cc:140] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
Testing...
Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/client/session.py", line 1322, in _do_call
    return fn(*args)
  File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/client/session.py", line 1307, in _run_fn
    options, feed_dict, fetch_list, target_list, run_metadata)
  File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/client/session.py", line 1409, in _call_tf_sessionrun
    run_metadata)
tensorflow.python.framework.errors_impl.InvalidArgumentError: Assign requires shapes of both tensors to match. lhs shape= [4,4,6,64] rhs shape= [4,4,4,64]
     [[Node: save/Assign_393 = Assign[T=DT_FLOAT, _class=["loc:@monnet/G_net/e1/weights"], use_locking=true, validate_shape=true, _device="/job:localhost/replica:0/task:0/device:CPU:0"](monnet/G_net/e1/weights, save/RestoreV2:393)]]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "main.py", line 153, in <module>
    tf.app.run()
  File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/platform/app.py", line 126, in run
    _sys.exit(main(argv))
  File "main.py", line 142, in main
    monnet.test(sess, views, num_test_shapes)
  File "/home/cadar/Documents/GitHub/SketchModeling/Network/code/MonsterNet/monnet.py", line 445, in test
    self.saver.restore(sess, ckpt.model_checkpoint_path)
  File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/training/saver.py", line 1802, in restore
    {self.saver_def.filename_tensor_name: save_path})
  File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/client/session.py", line 900, in run
    run_metadata_ptr)
  File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/client/session.py", line 1135, in _run
    feed_dict_tensor, options, run_metadata)
  File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/client/session.py", line 1316, in _do_run
    run_metadata)
  File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/client/session.py", line 1335, in _do_call
    raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.InvalidArgumentError: Assign requires shapes of both tensors to match. lhs shape= [4,4,6,64] rhs shape= [4,4,4,64]
     [[Node: save/Assign_393 = Assign[T=DT_FLOAT, _class=["loc:@monnet/G_net/e1/weights"], use_locking=true, validate_shape=true, _device="/job:localhost/replica:0/task:0/device:CPU:0"](monnet/G_net/e1/weights, save/RestoreV2:393)]]

Caused by op 'save/Assign_393', defined at:
  File "main.py", line 153, in <module>
    tf.app.run()
  File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/platform/app.py", line 126, in run
    _sys.exit(main(argv))
  File "main.py", line 142, in main
    monnet.test(sess, views, num_test_shapes)
  File "/home/cadar/Documents/GitHub/SketchModeling/Network/code/MonsterNet/monnet.py", line 442, in test
    self.saver = tf.train.Saver()
  File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/training/saver.py", line 1338, in __init__
    self.build()
  File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/training/saver.py", line 1347, in build
    self._build(self._filename, build_save=True, build_restore=True)
  File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/training/saver.py", line 1384, in _build
    build_save=build_save, build_restore=build_restore)
  File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/training/saver.py", line 835, in _build_internal
    restore_sequentially, reshape)
  File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/training/saver.py", line 494, in _AddRestoreOps
    assign_ops.append(saveable.restore(saveable_tensors, shapes))
  File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/training/saver.py", line 185, in restore
    self.op.get_shape().is_fully_defined())
  File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/ops/state_ops.py", line 283, in assign
    validate_shape=validate_shape)
  File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/ops/gen_state_ops.py", line 60, in assign
    use_locking=use_locking, name=name)
  File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/op_def_library.py", line 787, in _apply_op_helper
    op_def=op_def)
  File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/ops.py", line 3392, in create_op
    op_def=op_def)
  File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/ops.py", line 1718, in __init__
    self._traceback = self._graph._extract_stack()  # pylint: disable=protected-access
felipecadar commented 6 years ago

It works fine using only 2 points of view

HenriMir commented 6 years ago

In my understanding of the paper, you would have to retrain the network I think

happylun commented 6 years ago

Yes you will need to train a different network for different configuration of the views.