UnrecognizedFlagError: Unknown command line flag 'eval_flow'

Hello,

I am getting this error while trying to run this part of the code.

def main(unused_argv):
if FLAGS.trace == “”:
raise Exception(“OUT_DIR must be specified”)

print('Constructing models and inputs.')

if FLAGS.mode == "depthflow":  # stage 3: train depth and flow together
    Model = Model_depthflow
    Model_eval = Model_eval_depthflow

    opt.eval_flow = True
    opt.eval_depth = True
    opt.eval_mask = True
elif FLAGS.mode == "depth":  # stage 2: train depth
    Model = Model_depth
    Model_eval = Model_eval_depth

    opt.eval_flow = True
    opt.eval_depth = True
    opt.eval_mask = False
elif FLAGS.mode == "flow":  # stage 1: train flow
    Model = Model_flow
    Model_eval = Model_eval_flow

    opt.eval_flow = True
    opt.eval_depth = False
    opt.eval_mask = False
elif FLAGS.mode == "stereo":
    Model = Model_stereo
    Model_eval = Model_eval_stereo

    opt.eval_flow = False
    opt.eval_depth = True
    opt.eval_mask = False
else:
    raise Exception("mode must be one of flow, depth, depthflow or stereo")

This is the error I am getting:

2020-02-18 10:16:13.466300: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library ‘libnvinfer.so.5’; dlerror: libnvinfer.so.5: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /usr/local/cuda-10.0/lib64:
2020-02-18 10:16:13.466355: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library ‘libnvinfer_plugin.so.5’; dlerror: libnvinfer_plugin.so.5: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /usr/local/cuda-10.0/lib64:
2020-02-18 10:16:13.466363: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:30] Cannot dlopen some TensorRT libraries. If you would like to use Nvidia GPU with TensorRT, please make sure the missing libraries mentioned above are installed properly.
Constructing models and inputs.
Traceback (most recent call last):
File “main.py”, line 284, in
tf.compat.v1.app.run()
File “/home/kbdp5524/anaconda3/lib/python3.7/site-packages/tensorflow_core/python/platform/app.py”, line 40, in run
_run(main=main, argv=argv, flags_parser=_parse_flags_tolerate_undef)
File “/home/kbdp5524/anaconda3/lib/python3.7/site-packages/absl/app.py”, line 299, in run
_run_main(main, args)
File “/home/kbdp5524/anaconda3/lib/python3.7/site-packages/absl/app.py”, line 250, in _run_main
sys.exit(main(argv))
File “main.py”, line 94, in main
opt.eval_flow = True
File “/home/kbdp5524/anaconda3/lib/python3.7/site-packages/tensorflow_core/python/platform/flags.py”, line 88, in setattr
return self.dict[‘__wrapped’].setattr(name, value)
File “/home/kbdp5524/anaconda3/lib/python3.7/site-packages/absl/flags/_flagvalues.py”, line 499, in setattr
return self._set_unknown_flag(name, value)
File “/home/kbdp5524/anaconda3/lib/python3.7/site-packages/absl/flags/_flagvalues.py”, line 375, in _set_unknown_flag
raise _exceptions.UnrecognizedFlagError(name, value)
absl.flags._exceptions.UnrecognizedFlagError: Unknown command line flag ‘eval_flow’

Can anyone please tell me where I should correct? And, what is this error?

Thanks very much!

It seems you are using a Tensorflow model, while you’ve landed in the PyTorch discussion board. :wink:
I would recommend to create a topic in their forum or StackOverflow, as you will most likely get a better answer there.

Based on the raised error, I would assume your passed argument should be one of the strings checked in the if-condition (e.g. depthflow, depth, etc.).