rpautrat / SuperPoint

Efficient neural feature detector and descriptor
MIT License
1.88k stars 416 forks source link

Problem when doing step 1) Training MagicPoint on Synthetic Shapes #259

Closed alexjin98 closed 2 years ago

alexjin98 commented 2 years ago

Hi! I'm having this problem when trying to train the MagicPoint on Susthetic Shapes. I'm a beginner at this so sorry if this is a dumb question. Thank you.

Here is the terminal command and respective output:

(mlp) alexandre@Alexandres-MacBook-Air superpoint % python experiment.py train configs/magic-point_shapes.yaml magic-point_synth Traceback (most recent call last): File "experiment.py", line 153, in config = yaml.load(f) TypeError: load() missing 1 required positional argument: 'Loader'

rpautrat commented 2 years ago

Hi, what are your Python and pyyaml versions? Maybe try to upgrade them to the latest version.

alexjin98 commented 2 years ago

Hi. I have python 3.8 and pyyaml 6.0

Another thing, I cannot seem to download the COCO dataset from its website. Do not know if the issue has anything related to that.

rpautrat commented 2 years ago

I think the fix is actually to downgrade your pyyaml version (e.g. to version 5), as suggested here.

alexjin98 commented 2 years ago

Thank you. It solved the problem.

I now face another issue. Since I'm running on a macOS, I cannot run with the CUDA driver, as seen below.

Is there a solution for users using macOS running on an M1?

(mlp) alexandre@Alexandres-MacBook-Air superpoint % python experiment.py train configs/magic-point_shapes.yaml magic-point_synth experiment.py:153: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details. config = yaml.load(f) [06/10/2022 11:24:56 INFO] Running command TRAIN Traceback (most recent call last): File "experiment.py", line 160, in args.func(config, output_dir, args) File "experiment.py", line 97, in _cli_train train(config, config['train_iter'], output_dir, pretrained_dir) File "experiment.py", line 22, in train with _init_graph(config) as net: File "/opt/homebrew/Caskroom/miniforge/base/envs/mlp/lib/python3.8/contextlib.py", line 113, in enter return next(self.gen) File "experiment.py", line 68, in _init_graph n_gpus = get_num_gpus() File "experiment.py", line 62, in get_num_gpus return len(os.environ['CUDA_VISIBLE_DEVICES'].split(',')) File "/opt/homebrew/Caskroom/miniforge/base/envs/mlp/lib/python3.8/os.py", line 675, in getitem raise KeyError(key) from None KeyError: 'CUDA_VISIBLE_DEVICES'

rpautrat commented 2 years ago

Unfortunately, this code can only be run on GPU for now. I guess it could be made compatible with CPU by changing all the parts of the code using GPU into CPU, and removing the search for CUDA_VISIBLE_DEVICES, but this might require a bit of work...

alexjin98 commented 2 years ago

Ok. Thank you for your time!