YoYo000 / MVSNet

MVSNet (ECCV2018) & R-MVSNet (CVPR2019)
MIT License
1.4k stars 304 forks source link

BlendedMVS training does not work #145

Open Eren121 opened 2 years ago

Eren121 commented 2 years ago

Hello,

I try to train MVSNet with BlendedMVS. I just can't make it work with a very simple setup:

But I got this error. Complete Python log is:

Traceback (most recent call last):
  File "train.py", line 438, in <module>
    tf.app.run()
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/platform/app.py
", line 40, in run
    _run(main=main, argv=argv, flags_parser=_parse_flags_tolerate_undef)
  File "/usr/local/lib/python2.7/dist-packages/absl/app.py", line 312, in run
    _run_main(main, args)
  File "/usr/local/lib/python2.7/dist-packages/absl/app.py", line 258, in _run_m
ain
    sys.exit(main(argv))
  File "train.py", line 433, in main
    train(sample_list)
  File "train.py", line 392, in train
    [summary_op, train_opt, loss, less_one_accuracy, less_three_accuracy])
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.
py", line 950, in run
    run_metadata_ptr)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.
py", line 1173, in _run
    feed_dict_tensor, options, run_metadata)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.
py", line 1350, in _do_run
    run_metadata)
  File "/usr/local/lib/python2.7/dist-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) fo
und.
  (0) Invalid argument: Expected begin and size arguments to be 1-D tensors of s
ize 2, but got shapes [5] and [5] instead.
         [[node Model_tower0/Slice (defined at train.py:275) ]]
         [[Model_tower0/gradients/AddN_248/_1939]]
  (1) Invalid argument: Expected begin and size arguments to be 1-D tensors of s
ize 2, but got shapes [5] and [5] instead.
         [[node Model_tower0/Slice (defined at train.py:275) ]]
0 successful operations.
0 derived errors ignored.

Errors may have originated from an input operation.
Input Source operations connected to node Model_tower0/Slice:
 Model_tower0/IteratorGetNext (defined at train.py:270)

Input Source operations connected to node Model_tower0/Slice:
 Model_tower0/IteratorGetNext (defined at train.py:270)

Original stack trace for u'Model_tower0/Slice':
  File "train.py", line 438, in <module>
    tf.app.run()
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/platform/app.py
", line 40, in run
    _run(main=main, argv=argv, flags_parser=_parse_flags_tolerate_undef)
  File "/usr/local/lib/python2.7/dist-packages/absl/app.py", line 312, in run
    _run_main(main, args)
  File "/usr/local/lib/python2.7/dist-packages/absl/app.py", line 258, in _run_m
ain
    sys.exit(main(argv))
  File "train.py", line 433, in main
    train(sample_list)
  File "train.py", line 275, in train
    image = tf.squeeze(tf.slice(images, [0, view, 0, 0, 0], [-1, 1, -1, -1, 3]),
 axis=1)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/array_ops.p
y", line 733, in slice
    return gen_array_ops._slice(input_, begin, size, name=name)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/gen_array_o
ps.py", line 8823, in _slice
    "Slice", input=input, begin=begin, size=size, name=name)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/op_de
f_library.py", line 788, in _apply_op_helper
    op_def=op_def)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/util/deprecatio
n.py", line 507, in new_func
    return func(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.p
y", line 3616, in create_op
    op_def=op_def)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.p
y", line 2005, in __init__
    self._traceback = tf_stack.extract_stack()

Any idea? Thank you.

leo-frank commented 1 year ago

I have the same problem , how you solved it ?

MabeNice commented 1 year ago

I encountered the same problem. After debugging, I found that it was a file name error. The details are as follows: preprocess.py line 438 "ref_image_path = os.path.join(dataset_folder, 'blended_images', '%08d_masked.jpg' % ref_idx)" just delete "_masked" line 446 the same error.