0

#Full traceback

Exception ignored in: Exception ignored in: Exception ignored in: 
<bound method tqdm.__del__ of calculate covariances:   0%|<bar/>| 
0/100 [00:00<?, ?it/s]>Exception ignored in: <bound method 
tqdm.__del__ of calculate covariances:   0%|<bar/>| 0/100 
[00:00<?, ?it/s]><bound method tqdm.__del__ of calculate 
covariances:   0%|<bar/>| 0/100 [00:00<?, ?it/s]>
Exception ignored in: Exception ignored in: <bound method 
tqdm.__del__ of calculate covariances:   0%|<bar/>| 0/100 
[00:00<?, ?it/s]>Exception ignored in: Exception ignored in: 
Traceback (most recent call last):

<bound method tqdm.__del__ of calculate covariances:   0%|<bar/>| 
0/100 [00:00<?, ?it/s]><bound method tqdm.__del__ of calculate 
covariances:   0%|<bar/>| 0/100 [00:00<?, ?it/s]>
<bound method tqdm.__del__ of calculate covariances:   0%|<bar/>| 
0/100 [00:00<?, ?it/s]><bound method tqdm.__del__ of calculate 
covariances:   0%|<bar/>| 0/100 [00:00<?, ?it/s]>Traceback (most 
recent call last):
 File "/opt/anaconda3/envs/old_py/lib/python3.6/site-packages/tqdm/std.py", line 1055, in __del__
Traceback (most recent call last):

Traceback (most recent call last):


  File "/opt/anaconda3/envs/old_py/lib/python3.6/site-packages/tqdm/std.py", line 1055, in __del__

  File "/opt/anaconda3/envs/old_py/lib/python3.6/site-packages/tqdm/std.py", line 1055, in __del__
Traceback (most recent call last):
  File "/opt/anaconda3/envs/old_py/lib/python3.6/site-packages/tqdm/std.py", line 1055, in __del__
Traceback (most recent call last):
Traceback (most recent call last):
  
  self.close()
  Traceback (most recent call last):
  File "/opt/anaconda3/envs/old_py/lib/python3.6/site-packages/tqdm/std.py", line 1055, in __del__
      File "/opt/anaconda3/envs/old_py/lib/python3.6/site-packages/tqdm/std.py", line 1055, in __del__
  File "/opt/anaconda3/envs/old_py/lib/python3.6/site-packages/tqdm/std.py", line 1055, in __del__

  File "/opt/anaconda3/envs/old_py/lib/python3.6/site-packages/tqdm/std.py", line 1055, in __del__
self.close()self.close()self.close()               
File "/opt/anaconda3/envs/old_py/lib/python3.6/site-packages/tqdm/notebook.py", line 233, in closeself.close()self.close()self.close()      
File "/opt/anaconda3/envs/old_py/lib/python3.6/site-packages/tqdm/notebook.py", line 233, in close
self.close()  
File "/opt/anaconda3/envs/old_py/lib/python3.6/site-packages/tqdm/notebook.py", line 233, in close
File "/opt/anaconda3/envs/old_py/lib/python3.6/site-packages/tqdm/notebook.py", line 233, 

in close super(tqdm_notebook, self).close(*args, **kwargs)

File "/opt/anaconda3/envs/old_py/lib/python3.6/site-packages/tqdm/notebook.py", line 233, in close
File "/opt/anaconda3/envs/old_py/lib/python3.6/site-packages/tqdm/notebook.py", line 233, in close
File "/opt/anaconda3/envs/old_py/lib/python3.6/site-packages/tqdm/notebook.py", line 233, in close

File "/opt/anaconda3/envs/old_py/lib/python3.6/site-packages/tqdm/notebook.py", line 233, 
in close super(tqdm_notebook, self).close(*args,**kwargs)super(tqdm_notebook, self).close(*args,**kwargs)super(tqdm_notebook, self).close(*args, **kwargs)         
 File "/opt/anaconda3/envs/old_py/lib/python3.6/site-packages/tqdm/std.py", line 1264, in close super(tqdm_notebook, self).close(*args, **kwargs) super(tqdm_notebook, self).close(*args, **kwargs)super(tqdm_notebook, self).close(*args, **kwargs)super(tqdm_notebook, self).close(*args, **kwargs)
  File "/opt/anaconda3/envs/old_py/lib/python3.6/site-packages/tqdm/std.py", line 1264, in close

 File "/opt/anaconda3/envs/old_py/lib/python3.6/site-packages/tqdm/std.py", line 1264, in close
 File "/opt/anaconda3/envs/old_py/lib/python3.6/site-packages/tqdm/std.py", line 1264, in close



self.display(msg='', pos=pos)  
 File "/opt/anaconda3/envs/old_py/lib/python3.6/site-packages/tqdm/std.py", line 1264, in close
      File "/opt/anaconda3/envs/old_py/lib/python3.6/site-packages/tqdm/std.py", line 1264, in close
  File "/opt/anaconda3/envs/old_py/lib/python3.6/site-packages/tqdm/std.py", line 1264, in close
 File "/opt/anaconda3/envs/old_py/lib/python3.6/site-packages/tqdm/std.py", line 1264, in close

self.display(msg='', pos=pos)self.display(msg='', pos=pos)
self.display(msg='', pos=pos)      
File "/opt/anaconda3/envs/old_py/lib/python3.6/site-packages/tqdm/notebook.py", line 146, in display
    self.display(msg='', pos=pos)

self.display(msg='', pos=pos)
self.display(msg='', pos=pos)self.display(msg='', pos=pos)    
File "/opt/anaconda3/envs/old_py/lib/python3.6/site-packages/tqdm/notebook.py", line 146, in display

File "/opt/anaconda3/envs/old_py/lib/python3.6/site-packages/tqdm/notebook.py", line 146, in display
File "/opt/anaconda3/envs/old_py/lib/python3.6/site-packages/tqdm/notebook.py", line 146, in display


File "/opt/anaconda3/envs/old_py/lib/python3.6/site-packages/tqdm/notebook.py", line 146, in display
pbar, ptext = self.container.children      
  File "/opt/anaconda3/envs/old_py/lib/python3.6/site-packages/tqdm/notebook.py", line 146, in display
      File "/opt/anaconda3/envs/old_py/lib/python3.6/site-packages/tqdm/notebook.py", line 146, in display
  File "/opt/anaconda3/envs/old_py/lib/python3.6/site-packages/tqdm/notebook.py", line 146, in display

pbar, ptext = self.container.children    
pbar, ptext = self.container.childrenpbar, ptext = 
self.container.childrenpbar, ptext = self.container.children    
AttributeError   
pbar, ptext = self.container.children


pbar, ptext = self.container.children
pbar, ptext = self.container.children: AttributeError
AttributeErrorAttributeErrorAttributeError
'function' object has no attribute 'children'
: : AttributeError: AttributeError
: AttributeError'function' object has no attribute 
'children''function' object has no attribute 'children''function' 
object has no attribute 'children': : : 'function' object has no 
attribute 'children'


'function' object has no attribute 'children''function' object 
has no attribute 'children''function' object has no attribute 
'children'

Error message:

    AttributeError                            Traceback (most recent call last)
    <ipython-input-363-d63966a98030> in <module>
     35 
     36 with Pool() as pool:
    ---> 37       results = pool.starmap(run_SpectraloASIS,parameters)
     38 
     39 

/opt/anaconda3/envs/old_py/lib/python3.6/multiprocessing/pool.py in starmap(self, func, iterable,    chunksize)
    272         `func` and (a, b) becomes func(a, b).
    273         '''
--> 274         return self._map_async(func, iterable, starmapstar, chunksize).get()
    275 
    276     def starmap_async(self, func, iterable, chunksize=None, callback=None,

/opt/anaconda3/envs/old_py/lib/python3.6/multiprocessing/pool.py in get(self, timeout)
    642             return self._value
    643         else:
--> 644             raise self._value
    645 
    646     def _set(self, i, obj):

AttributeError: 'function' object has no attribute 'children'

Original code:

def run_SpectraloASIS(max_columns,lt=lt,dt=dt,num_features=num_features,
                      input_feature_data=input_feature_data,
                      spectraldir='./SpectralOasis/'):
    
    
    
    t = NystroemTICA(lt, max_columns, initial_columns=np.random.choice(num_features,1,replace=False), nsel=20)
    
    
    t.estimate(input_feature_data)  ##running oasis_tica
    os.makedirs('{}{}'.format(spectraldir,int(lt)),exist_ok=True)
    np.savetxt("{}{}/feature_column{}_ticalag_{}.txt".format(spectraldir,int(lt),max_columns,int(lt)), t.column_indices, fmt='%d')
    np.savetxt("{}{}/timescales_column{}_ticalag_{}.txt".format(spectraldir,int(lt),max_columns,int(lt)), t.timescales)
    return lt,max_columns,t.timescales

with Pool() as pool:
results = pool.starmap(run_SpectraloASIS,parameters)

df = pd.DataFrame(results)
df.to_pickle("{}timescales.pickl".format(spectraldir))

Trying to define function with following parameters: Running Spectral oASIS

Parameters
----------
max_columns : int
    The number of features to be selected

input_feature_data: list containing ndarrays(dtype=int) or ndarray(n, dtype=int))
    features to be selected

num_features: int
    The number of features in the full set

spectraldir: str, default="./SpectralOasis/"
    The directory to save output

and return:

t.timescales: timescales for tlCA perform with this number of features

It looks like there's a conflict between the "tqdm" library and Jupyter Notebook, where close() is being called multiple time

DaPi123
  • 1
  • 1
  • you need to post the **FULL** traceback, you show only the second traceback that destroys the main thread, not the actual bug traceback, anyway there is most likely a problem somewhere in your usage, consider using a debugger to solve it or post a minimal example of the problem that others can run. – Ahmed AEK Feb 07 '23 at 09:27
  • this "might" be a bug in tqdm when used with multiprocessing inside a jupyter notebook ... you might want to run the code as a script instead of using jupyter to see if it fixes the problem, or not use tqdm in your logging, or maybe update everything to the latest version. – Ahmed AEK Feb 07 '23 at 15:50

0 Answers0