CLoDSA icon indicating copy to clipboard operation
CLoDSA copied to clipboard

augmentor.applyAugmentation() causes Error

Open ketand334 opened this issue 3 years ago • 3 comments

After adding transformers to the augmentor, augmentor.applyAugmentation() generates the following error:

c:\users\ketan agarwal\appdata\local\programs\python\python36\lib\site-packages\joblib\externals\loky\backend\resource_tracker.py in _send(self, cmd, name, rtype) 207 # bytes are atomic, and that PIPE_BUF >= 512 208 raise ValueError('name too long') --> 209 nbytes = os.write(self._fd, msg) 210 assert nbytes == len(msg) 211

OSError: [Errno 22] Invalid argument

ketand334 avatar Feb 11 '21 10:02 ketand334

Could you send me a minimal example to reproduce the error?

joheras avatar Feb 11 '21 10:02 joheras

os.chdir('D:\Projects\used-car-masking') # where my source folder is kept PROBLEM = "detection" ANNOTATION_MODE = "yolo" INPUT_PATH = "test_augmentation/" GENERATION_MODE = "linear" OUTPUT_MODE = "yolo" OUTPUT_PATH= "augmented_images_yolo" augmentor = createAugmentor(PROBLEM,ANNOTATION_MODE,OUTPUT_MODE,GENERATION_MODE,INPUT_PATH,{"outputPath":OUTPUT_PATH})

transformer = transformerGenerator(PROBLEM)

vFlip = createTechnique("flip",{"flip":0}) augmentor.addTransformer(transformer(vFlip))

rotate = createTechnique("rotate", {"angle" : 90}) augmentor.addTransformer(transformer(rotate))

augmentor.applyAugmentation() #this generates error.

However, I have tried using the same code it is working fine on colab but not on my windows jupyter notebook. Could you please help me out?

Error: OSError Traceback (most recent call last) in ----> 1 augmentor.applyAugmentation()

c:\users\ketan agarwal\appdata\local\programs\python\python36\lib\site-packages\clodsa\augmentors\yoloLinearDetectionAugmentor.py in applyAugmentation(self) 89 if not(os._exists(self.outputPath)): 90 os.makedirs(self.outputPath) ---> 91 Parallel(n_jobs=-1)(delayed(readAndGenerateImage)(self.outputPath,self.transformers,x) for x in enumerate(self.imagePaths)) 92 93

c:\users\ketan agarwal\appdata\local\programs\python\python36\lib\site-packages\joblib\parallel.py in call(self, iterable) 964 965 if not self._managed_backend: --> 966 n_jobs = self._initialize_backend() 967 else: 968 n_jobs = self._effective_n_jobs()

c:\users\ketan agarwal\appdata\local\programs\python\python36\lib\site-packages\joblib\parallel.py in _initialize_backend(self) 732 try: 733 n_jobs = self._backend.configure(n_jobs=self.n_jobs, parallel=self, --> 734 **self._backend_args) 735 if self.timeout is not None and not self._backend.supports_timeout: 736 warnings.warn(

c:\users\ketan agarwal\appdata\local\programs\python\python36\lib\site-packages\joblib_parallel_backends.py in configure(self, n_jobs, parallel, prefer, require, idle_worker_timeout, **memmappingexecutor_args) 495 n_jobs, timeout=idle_worker_timeout, 496 env=self._prepare_worker_env(n_jobs=n_jobs), --> 497 context_id=parallel._id, **memmappingexecutor_args) 498 self.parallel = parallel 499 return n_jobs

c:\users\ketan agarwal\appdata\local\programs\python\python36\lib\site-packages\joblib\executor.py in get_memmapping_executor(n_jobs, **kwargs) 18 19 def get_memmapping_executor(n_jobs, **kwargs): ---> 20 return MemmappingExecutor.get_memmapping_executor(n_jobs, **kwargs) 21 22

c:\users\ketan agarwal\appdata\local\programs\python\python36\lib\site-packages\joblib\executor.py in get_memmapping_executor(cls, n_jobs, timeout, initializer, initargs, env, temp_folder, context_id, **backend_args) 40 _executor_args = executor_args 41 ---> 42 manager = TemporaryResourcesManager(temp_folder) 43 44 # reducers access the temporary folder in which to store temporary

c:\users\ketan agarwal\appdata\local\programs\python\python36\lib\site-packages\joblib_memmapping_reducer.py in init(self, temp_folder_root, context_id) 529 # exposes exposes too many low-level details. 530 context_id = uuid4().hex --> 531 self.set_current_context(context_id) 532 533 def set_current_context(self, context_id):

c:\users\ketan agarwal\appdata\local\programs\python\python36\lib\site-packages\joblib_memmapping_reducer.py in set_current_context(self, context_id) 533 def set_current_context(self, context_id): 534 self._current_context_id = context_id --> 535 self.register_new_context(context_id) 536 537 def register_new_context(self, context_id):

c:\users\ketan agarwal\appdata\local\programs\python\python36\lib\site-packages\joblib_memmapping_reducer.py in register_new_context(self, context_id) 558 new_folder_name, self._temp_folder_root 559 ) --> 560 self.register_folder_finalizer(new_folder_path, context_id) 561 self._cached_temp_folders[context_id] = new_folder_path 562

c:\users\ketan agarwal\appdata\local\programs\python\python36\lib\site-packages\joblib_memmapping_reducer.py in register_folder_finalizer(self, pool_subfolder, context_id) 588 # semaphores and pipes 589 pool_module_name = whichmodule(delete_folder, 'delete_folder') --> 590 resource_tracker.register(pool_subfolder, "folder") 591 592 def _cleanup():

c:\users\ketan agarwal\appdata\local\programs\python\python36\lib\site-packages\joblib\externals\loky\backend\resource_tracker.py in register(self, name, rtype) 188 def register(self, name, rtype): 189 '''Register a named resource, and increment its refcount.''' --> 190 self.ensure_running() 191 self._send('REGISTER', name, rtype) 192

c:\users\ketan agarwal\appdata\local\programs\python\python36\lib\site-packages\joblib\externals\loky\backend\resource_tracker.py in ensure_running(self) 100 if self._fd is not None: 101 # resource tracker was launched before, is it still running? --> 102 if self._check_alive(): 103 # => still alive 104 return

c:\users\ketan agarwal\appdata\local\programs\python\python36\lib\site-packages\joblib\externals\loky\backend\resource_tracker.py in _check_alive(self) 180 '''Check for the existence of the resource tracker process.''' 181 try: --> 182 self._send('PROBE', '', '') 183 except BrokenPipeError: 184 return False

c:\users\ketan agarwal\appdata\local\programs\python\python36\lib\site-packages\joblib\externals\loky\backend\resource_tracker.py in _send(self, cmd, name, rtype) 207 # bytes are atomic, and that PIPE_BUF >= 512 208 raise ValueError('name too long') --> 209 nbytes = os.write(self._fd, msg) 210 assert nbytes == len(msg) 211

OSError: [Errno 22] Invalid argument

ketand334 avatar Feb 11 '21 12:02 ketand334

Are you using your own dataset or are you using the sample dataset that is used in the colab notebook? If you are using your own dataset, try first the dataset available in colab to know if it is a problem with clodsa code or with the organization of your dataset. Best, Jónathan

El jue., 11 feb. 2021 13:50, ketand334 [email protected] escribió:

os.chdir('D:\Projects\used-car-masking') # where my source folder is kept PROBLEM = "detection" ANNOTATION_MODE = "yolo" INPUT_PATH = "test_augmentation/" GENERATION_MODE = "linear" OUTPUT_MODE = "yolo" OUTPUT_PATH= "augmented_images_yolo" augmentor = createAugmentor(PROBLEM,ANNOTATION_MODE,OUTPUT_MODE,GENERATION_MODE,INPUT_PATH,{"outputPath":OUTPUT_PATH})

transformer = transformerGenerator(PROBLEM)

vFlip = createTechnique("flip",{"flip":0}) augmentor.addTransformer(transformer(vFlip))

rotate = createTechnique("rotate", {"angle" : 90}) augmentor.addTransformer(transformer(rotate))

augmentor.applyAugmentation() #this generates error.

However, I have tried using the same code it is working fine on colab but not on my windows jupyter notebook. Could you please help me out?

Error: OSError Traceback (most recent call last) in ----> 1 augmentor.applyAugmentation()

c:\users\ketan agarwal\appdata\local\programs\python\python36\lib\site-packages\clodsa\augmentors\yoloLinearDetectionAugmentor.py in applyAugmentation(self) 89 if not(os._exists(self.outputPath)): 90 os.makedirs(self.outputPath) ---> 91 Parallel(n_jobs=-1)(delayed(readAndGenerateImage)(self.outputPath,self.transformers,x) for x in enumerate(self.imagePaths)) 92 93

c:\users\ketan agarwal\appdata\local\programs\python\python36\lib\site-packages\joblib\parallel.py in call(self, iterable) 964 965 if not self._managed_backend: --> 966 n_jobs = self._initialize_backend() 967 else: 968 n_jobs = self._effective_n_jobs()

c:\users\ketan agarwal\appdata\local\programs\python\python36\lib\site-packages\joblib\parallel.py in _initialize_backend(self) 732 try: 733 n_jobs = self._backend.configure(n_jobs=self.n_jobs, parallel=self, --> 734 **self._backend_args) 735 if self.timeout is not None and not self._backend.supports_timeout: 736 warnings.warn(

c:\users\ketan agarwal\appdata\local\programs\python\python36\lib\site-packages\joblib_parallel_backends.py in configure(self, n_jobs, parallel, prefer, require, idle_worker_timeout, **memmappingexecutor_args) 495 n_jobs, timeout=idle_worker_timeout, 496 env=self._prepare_worker_env(n_jobs=n_jobs), --> 497 context_id=parallel._id, **memmappingexecutor_args) 498 self.parallel = parallel 499 return n_jobs

c:\users\ketan agarwal\appdata\local\programs\python\python36\lib\site-packages\joblib\executor.py in get_memmapping_executor(n_jobs, **kwargs) 18 19 def get_memmapping_executor(n_jobs, **kwargs): ---> 20 return MemmappingExecutor.get_memmapping_executor(n_jobs, **kwargs) 21 22

c:\users\ketan agarwal\appdata\local\programs\python\python36\lib\site-packages\joblib\executor.py in get_memmapping_executor(cls, n_jobs, timeout, initializer, initargs, env, temp_folder, context_id, **backend_args) 40 _executor_args = executor_args 41 ---> 42 manager = TemporaryResourcesManager(temp_folder) 43 44 # reducers access the temporary folder in which to store temporary

c:\users\ketan agarwal\appdata\local\programs\python\python36\lib\site-packages\joblib_memmapping_reducer.py in init(self, temp_folder_root, context_id) 529 # exposes exposes too many low-level details. 530 context_id = uuid4().hex --> 531 self.set_current_context(context_id) 532 533 def set_current_context(self, context_id):

c:\users\ketan agarwal\appdata\local\programs\python\python36\lib\site-packages\joblib_memmapping_reducer.py in set_current_context(self, context_id) 533 def set_current_context(self, context_id): 534 self._current_context_id = context_id --> 535 self.register_new_context(context_id) 536 537 def register_new_context(self, context_id):

c:\users\ketan agarwal\appdata\local\programs\python\python36\lib\site-packages\joblib_memmapping_reducer.py in register_new_context(self, context_id) 558 new_folder_name, self._temp_folder_root 559 ) --> 560 self.register_folder_finalizer(new_folder_path, context_id) 561 self._cached_temp_folders[context_id] = new_folder_path 562

c:\users\ketan agarwal\appdata\local\programs\python\python36\lib\site-packages\joblib_memmapping_reducer.py in register_folder_finalizer(self, pool_subfolder, context_id) 588 # semaphores and pipes 589 pool_module_name = whichmodule(delete_folder, 'delete_folder') --> 590 resource_tracker.register(pool_subfolder, "folder") 591 592 def _cleanup():

c:\users\ketan agarwal\appdata\local\programs\python\python36\lib\site-packages\joblib\externals\loky\backend\resource_tracker.py in register(self, name, rtype) 188 def register(self, name, rtype): 189 '''Register a named resource, and increment its refcount.''' --> 190 self.ensure_running() 191 self._send('REGISTER', name, rtype) 192

c:\users\ketan agarwal\appdata\local\programs\python\python36\lib\site-packages\joblib\externals\loky\backend\resource_tracker.py in ensure_running(self) 100 if self._fd is not None: 101 # resource tracker was launched before, is it still running? --> 102 if self._check_alive(): 103 # => still alive 104 return

c:\users\ketan agarwal\appdata\local\programs\python\python36\lib\site-packages\joblib\externals\loky\backend\resource_tracker.py in _check_alive(self) 180 '''Check for the existence of the resource tracker process.''' 181 try: --> 182 self._send('PROBE', '', '') 183 except BrokenPipeError: 184 return False

c:\users\ketan agarwal\appdata\local\programs\python\python36\lib\site-packages\joblib\externals\loky\backend\resource_tracker.py in _send(self, cmd, name, rtype) 207 # bytes are atomic, and that PIPE_BUF >= 512 208 raise ValueError('name too long') --> 209 nbytes = os.write(self._fd, msg) 210 assert nbytes == len(msg) 211

OSError: [Errno 22] Invalid argument

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/joheras/CLoDSA/issues/24#issuecomment-777431944, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABJRAG3QUMNC7ADHZ47TZHLS6PG7ZANCNFSM4XOSZVCQ .

joheras avatar Feb 11 '21 13:02 joheras