SimonBiggs / npgamma

Using numpy broadcasting to find the gamma index
GNU Affero General Public License v3.0
19 stars 7 forks source link

BrokenPipeError: [Errno 32] Broken pipe #19

Closed ghost closed 5 years ago

ghost commented 5 years ago

I try to run the example code in Module usage 2D.ipynb or Module usage 3D.ipynb. When I get to the calc_gamma line, I get the following error:

File "", line 1, in gamma = calc_gamma(coords_reference, dose_reference,coords_evaluation, dose_evaluation, distance_threshold, dose_threshold, lower_dose_cutoff=lower_dose_cutoff, distance_step_size=distance_step_size, maximum_test_distance=maximum_test_distance, max_concurrent_calc_points=max_concurrent_calc_points, num_threads=num_threads)

File "C:\ProgramData\Anaconda3\lib\site-packages\npgamma__init__.py", line 324, in calc_gamma np.nan * np.ones_like(dose_evaluation_flat))).start()

File "C:\ProgramData\Anaconda3\lib\multiprocessing\process.py", line 105, in start self._popen = self._Popen(self)

File "C:\ProgramData\Anaconda3\lib\multiprocessing\context.py", line 223, in _Popen return _default_context.get_context().Process._Popen(process_obj)

File "C:\ProgramData\Anaconda3\lib\multiprocessing\context.py", line 322, in _Popen return Popen(process_obj)

File "C:\ProgramData\Anaconda3\lib\multiprocessing\popen_spawn_win32.py", line 65, in init reduction.dump(process_obj, to_child)

File "C:\ProgramData\Anaconda3\lib\multiprocessing\reduction.py", line 60, in dump ForkingPickler(file, protocol).dump(obj)

BrokenPipeError: [Errno 32] Broken pipe

ghost commented 5 years ago

Got it to work by adding

if name == 'main':

before the gamma = calc_gamma line

SimonBiggs commented 5 years ago

Good to hear :)