benchmarks icon indicating copy to clipboard operation
benchmarks copied to clipboard

missing arguments

Open dcmrlee opened this issue 8 years ago • 4 comments

I got a error when using [--variable_update=distributed_all_reduce]

Traceback (most recent call last):
  File "tf_cnn_benchmarks.py", line 60, in <module>
    app.run(main)  # Raises error on invalid flags, unlike tf.app.run()
  File "/usr/local/lib/python3.5/dist-packages/absl/app.py", line 274, in run
    _run_main(main, argv)
  File "/usr/local/lib/python3.5/dist-packages/absl/app.py", line 238, in _run_main
    sys.exit(main(argv))
  File "tf_cnn_benchmarks.py", line 56, in main
    bench.run()
  File "/tmp/bench/benchmark_cnn.py", line 1384, in run
    return self._benchmark_cnn()
  File "/tmp/bench/benchmark_cnn.py", line 1503, in _benchmark_cnn
    self._build_model_single_session_with_dataset_prefetching())
  File "/tmp/bench/benchmark_cnn.py", line 2187, in _build_model_single_session_with_dataset_prefetching
    self.devices, self.dataset)
TypeError: build_prefetch_image_processing() missing 2 required positional arguments: 'gpu_devices' and 'dataset'

Dive into src, I found data_utils.build_prefetch_image_processing() need 9 arguments, but in file benchmark_cnn.py:2184, only passed 7 arguments, as followed

data_utils.build_prefetch_image_processing(
          self.model.get_image_size(), self.model.get_image_size(),
          self.batch_size // len(self.devices), self.cpu_device, self.params,
          self.devices, self.dataset)

Can I fix it using the following code ?

data_utils.build_prefetch_image_processing(
          self.model.get_image_size(), self.model.get_image_size(),
          self.batch_size // len(self.devices), len(self.devices), self.image_preprocessor.parse_and_preprocess, self.cpu_device, self.params,
          self.devices, self.dataset)

dcmrlee avatar May 30 '18 10:05 dcmrlee

This will be fixed once #193 is merged, which should be soon.

reedwm avatar May 30 '18 17:05 reedwm

Thanks.

dcmrlee avatar Jun 26 '18 09:06 dcmrlee

@reedwm Will this fixed code be merged into cnn_tf_v1.8_compatible branch? I am using source installed tensorflow v1.8 to run distributed training and facing the same issue when set to distributed_all_reduce. I try to update the benchmark-master to the version merged with #193, but I get another error seems mismatch between benchmark and tensorflow v1.8.

Traceback (most recent call last): File "tf_cnn_benchmarks.py", line 27, in import benchmark_cnn File "/home/benchmarks-3cf76cb4035283cb30977d4ad7f007c6f08706f4/scripts/tf_cnn_benchmarks/benchmark_cnn.py", line 51, in import variable_mgr File "/home/benchmarks-3cf76cb4035283cb30977d4ad7f007c6f08706f4/scripts/tf_cnn_benchmarks/variable_mgr.py", line 25, in import allreduce File "/home/benchmarks-3cf76cb4035283cb30977d4ad7f007c6f08706f4/scripts/tf_cnn_benchmarks/allreduce.py", line 28, in from tensorflow.python.ops import collective_ops ImportError: cannot import name 'collective_ops'

Another question I think most users concern about, whether the different compatible branch is the newest one with those suitable bug fixed or code updated or not? Or if we want to use the new feature of benchmark we could only use tf-nightly-gpu with the newest benchmark-master?

Hannah-xxl avatar Aug 21 '18 07:08 Hannah-xxl

The cnn_tf_vX.X_compatible_branches are set to the latest version of tf_cnn_benchmarks that works with the corresponding version of TensorFlow, so I do not plan on merging bugfixes into them.

If you want the latest features and bugfixes, you should use tf-nightly-gpu and the master branch of this repo.

reedwm avatar Aug 27 '18 23:08 reedwm