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

BlendedMVS training does not work #145

Open
Eren121 opened this issue Aug 1, 2022 · 2 comments
Open

BlendedMVS training does not work #145

Eren121 opened this issue Aug 1, 2022 · 2 comments

Comments

@Eren121
Copy link

Eren121 commented Aug 1, 2022

Hello,

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

  • No modification to the code
  • python2 train.py --train_blendedmvs --blendedmvs_data_root /data/blendedmvs --regularization '3DCNNs' --max_w 768 --max_h 576 --max_d 128 --online_augmentation --model_folder /data/tf_model (just like in the readme)

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.

@Eren121 Eren121 changed the title Tensorflow error : 'expected begin an size to be 1-D tensor of size 2 but go shape [5] and [5]' BlendedMVS train does not work Aug 1, 2022
@Eren121 Eren121 changed the title BlendedMVS train does not work BlendedMVS training does not work Aug 1, 2022
@leo-frank
Copy link

I have the same problem , how you solved it ?

@MabeNice
Copy link

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.

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

3 participants