yzcjtr / GeoNet

Code for GeoNet: Unsupervised Learning of Dense Depth, Optical Flow and Camera Pose (CVPR 2018)
MIT License
723 stars 181 forks source link

How to set the dump_root path? #38

Closed jungdaechul-coderepo closed 5 years ago

jungdaechul-coderepo commented 5 years ago

I just preparing the data followed by your code prepare_trin_data.py

But, dump_root path rose the error while executing that code as like this.

python data/prepare_train_data.py --dataset_dir=dataset/raw_data_downloader/ --dataset_name=kitti_raw_eigen --dump_root=dataset/dump/ --seq_length=3 --img_height=128 --img_width=416 --num_threads=8 --remove_static

I attached the TrackBack error log below.

jhm@vclab:~/GeoNet-master/GeoNet-master$ python data/prepare_train_data.py --dataset_dir=dataset/raw_data_downloader/ --dataset_name=kitti_raw_eigen --dump_root=dataset/dump/ --seq_length=3 --img_height=128 --img_width=416 --num_threads=8 --remove_static
Progress 0/45016....
Traceback (most recent call last):
  File "data/prepare_train_data.py", line 110, in <module>
    main()
  File "data/prepare_train_data.py", line 92, in main
    Parallel(n_jobs=args.num_threads)(delayed(dump_example)(n) for n in range(data_loader.num_train))
  File "/home/jhm/miniconda2/lib/python2.7/site-packages/joblib/parallel.py", line 934, in __call__
    self.retrieve()
  File "/home/jhm/miniconda2/lib/python2.7/site-packages/joblib/parallel.py", line 862, in retrieve
    raise exception.unwrap(this_report)
joblib.my_exceptions.JoblibAttributeError: JoblibAttributeError
___________________________________________________________________________
...........................................................................
/home/jhm/GeoNet-master/GeoNet-master/data/prepare_train_data.py in <module>()
    105                     if np.random.random() < 0.1:
    106                         vf.write('%s %s\n' % (s, frame))
    107                     else:
    108                         tf.write('%s %s\n' % (s, frame))
    109
--> 110 main()
    111

...........................................................................
/home/jhm/GeoNet-master/GeoNet-master/data/prepare_train_data.py in main()
     87         data_loader = cityscapes_loader(args.dataset_dir,
     88                                         img_height=args.img_height,
     89                                         img_width=args.img_width,
     90                                         seq_length=args.seq_length)
     91
---> 92     Parallel(n_jobs=args.num_threads)(delayed(dump_example)(n) for n in range(data_loader.num_train))
     93
     94     # Split into train/val
     95     np.random.seed(8964)
     96     subfolders = os.listdir(args.dump_root)

...........................................................................
/home/jhm/miniconda2/lib/python2.7/site-packages/joblib/parallel.py in __call__(self=Parallel(n_jobs=8), iterable=<generator object <genexpr>>)
    929                 # No need to wait for async callbacks to trigger to
    930                 # consumption.
    931                 self._iterating = False
    932
    933             with self._backend.retrieval_context():
--> 934                 self.retrieve()
        self.retrieve = <bound method Parallel.retrieve of Parallel(n_jobs=8)>
    935             # Make sure that we get a last message telling us we are done
    936             elapsed_time = time.time() - self._start_time
    937             self._print('Done %3i out of %3i | elapsed: %s finished',
    938                         (len(self._output), len(self._output),

---------------------------------------------------------------------------
Joblib worker traceback:
---------------------------------------------------------------------------
AttributeError                                     Wed Feb 13 22:07:02 2019
PID: 27037                   Python 2.7.15: /home/jhm/miniconda2/bin/python
...........................................................................
/home/jhm/miniconda2/lib/python2.7/site-packages/joblib/parallel.py in __call__(self=<joblib.parallel.BatchedCalls object>)
    220     def __call__(self):
    221         # Set the default nested backend to self._backend but do not set the
    222         # change the default number of processes to -1
    223         with parallel_backend(self._backend, n_jobs=self._n_jobs):
    224             return [func(*args, **kwargs)
--> 225                     for func, args, kwargs in self.items]
        func = <function dump_example>
        args = (1,)
        kwargs = {}
        self.items = [(<function dump_example>, (1,), {})]
    226
    227     def __len__(self):
    228         return self._size
    229

...........................................................................
/home/jhm/miniconda2/lib/python2.7/site-packages/joblib/externals/loky/backend/popen_loky_posix.py in dump_example(n=1)
     37     intrinsics = example['intrinsics']
     38     fx = intrinsics[0, 0]
     39     fy = intrinsics[1, 1]
     40     cx = intrinsics[0, 2]
     41     cy = intrinsics[1, 2]
---> 42     dump_dir = os.path.join(args.dump_root, example['folder_name'])
     43
     44     try:
     45         os.makedirs(dump_dir)
     46     except OSError:

AttributeError: 'Namespace' object has no attribute 'dump_root'

How can I prepare the dump_root file path? Thanks

yzcjtr commented 5 years ago

Hi, this is a little strange. Is your joblib package installed properly?

zacr0 commented 5 years ago

The solution I proposed in https://github.com/yzcjtr/GeoNet/pull/28 worked for me, hope it works for you too.

yzcjtr commented 5 years ago

@zacr0 Thanks for your PR. Seems it works fine. Sorry I didn't notice it. I have already merged it.

zacr0 commented 5 years ago

Thanks! Glad I could help.

jungdaechul-coderepo commented 5 years ago

Thanks @yzcjtr , @zacr0 I will try again :)