tatarchm / tangent_conv

Tangent Convolutions for Dense Prediction in 3D
121 stars 26 forks source link

name 'scan' is not defined #11

Closed youkenhou closed 6 years ago

youkenhou commented 6 years ago

@tatarchm First of all, thank you for your great work. I'm trying to train on a different outdoor dataset so I followed the experiment of semantic3d. However I got the following error during training.

Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/joblib/externals/loky/process_executor.py", line 420, in _process_worker
    r = call_item.fn(*call_item.args, **call_item.kwargs)
  File "/usr/local/lib/python3.5/dist-packages/joblib/_parallel_backends.py", line 563, in __call__
    return self.func(*args, **kwargs)
  File "/usr/local/lib/python3.5/dist-packages/joblib/parallel.py", line 261, in __call__
    for func, args, kwargs in self.items]
  File "/usr/local/lib/python3.5/dist-packages/joblib/parallel.py", line 261, in <listcomp>
    for func, args, kwargs in self.items]
  File "util/cloud.py", line 232, in get_scan_part_out
    num_scales = len(scan.clouds)
NameError: name 'scan' is not defined
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "tc.py", line 26, in <module>
    run_net(config, "train")
  File "util/model.py", line 399, in run_net
    nn.precompute_validation_batches()
  File "util/model.py", line 114, in precompute_validation_batches
    batch_array = get_batch_array(test_scan, self.par)
  File "util/cloud.py", line 325, in get_batch_array
    delayed(get_scan_part_out)(par, pts[i]) for i in range(0, arr_size))
  File "/usr/local/lib/python3.5/dist-packages/joblib/parallel.py", line 996, in __call__
    self.retrieve()
  File "/usr/local/lib/python3.5/dist-packages/joblib/parallel.py", line 899, in retrieve
    self._output.extend(job.get(timeout=self.timeout))
  File "/usr/local/lib/python3.5/dist-packages/joblib/_parallel_backends.py", line 517, in wrap_future_result
    return future.result(timeout=timeout)
  File "/usr/lib/python3.5/concurrent/futures/_base.py", line 405, in result
    return self.__get_result()
  File "/usr/lib/python3.5/concurrent/futures/_base.py", line 357, in __get_result
    raise self._exception
NameError: name 'scan' is not defined

In the code file cloud.py, I noticed that the function get_scan_part_out is called by get_batch_array. Just give a try, I added a parameter def get_scan_part_out(scan, par, point=None, sample_type='POINT'): and added an argument delayed(get_scan_part_out)(scan, par, pts[i]) for i in range(0, arr_size). However I ran into another error as following

joblib.externals.loky.process_executor._RemoteTraceback: 
"""
Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/joblib/externals/loky/process_executor.py", line 420, in _process_worker
    r = call_item.fn(*call_item.args, **call_item.kwargs)
  File "/usr/local/lib/python3.5/dist-packages/joblib/_parallel_backends.py", line 563, in __call__
    return self.func(*args, **kwargs)
  File "/usr/local/lib/python3.5/dist-packages/joblib/parallel.py", line 261, in __call__
    for func, args, kwargs in self.items]
  File "/usr/local/lib/python3.5/dist-packages/joblib/parallel.py", line 261, in <listcomp>
    for func, args, kwargs in self.items]
  File "util/cloud.py", line 249, in get_scan_part_out
    [k_valid, idx_valid, _] = scan.trees[0].search_radius_vector_3d(random_point, radius=par.valid_rad)
RuntimeError: search_radius_vector_3d() error!
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "tc.py", line 26, in <module>
    run_net(config, "train")
  File "util/model.py", line 399, in run_net
    nn.precompute_validation_batches()
  File "util/model.py", line 114, in precompute_validation_batches
    batch_array = get_batch_array(test_scan, self.par)
  File "util/cloud.py", line 329, in get_batch_array
    delayed(get_scan_part_out)(scan, par, pts[i]) for i in range(0, arr_size))
  File "/usr/local/lib/python3.5/dist-packages/joblib/parallel.py", line 996, in __call__
    self.retrieve()
  File "/usr/lib/python3.5/contextlib.py", line 77, in __exit__
    self.gen.throw(type, value, traceback)
  File "/usr/local/lib/python3.5/dist-packages/joblib/_parallel_backends.py", line 148, in retrieval_context
    yield
  File "/usr/local/lib/python3.5/dist-packages/joblib/parallel.py", line 996, in __call__
    self.retrieve()
  File "/usr/local/lib/python3.5/dist-packages/joblib/parallel.py", line 899, in retrieve
    self._output.extend(job.get(timeout=self.timeout))
  File "/usr/local/lib/python3.5/dist-packages/joblib/_parallel_backends.py", line 517, in wrap_future_result
    return future.result(timeout=timeout)
  File "/usr/lib/python3.5/concurrent/futures/_base.py", line 405, in result
    return self.__get_result()
  File "/usr/lib/python3.5/concurrent/futures/_base.py", line 357, in __get_result
    raise self._exception
RuntimeError: search_radius_vector_3d() error!

I'm using ubuntu16.04, python3.5 and tesorflow1.3.0. I'm new to python. Could you please tell me how to resolve it or any reason that may cause it? Thank you very much.

MiZhenxing commented 6 years ago

I encountered the same problem. It's a case of joblib. Do not use the latest version of joblib. I used joblib-0.11 and did not get an error.

youkenhou commented 6 years ago

@MiZhenxing Excellent! It works now. Thank you so much.