jbohnslav / deepethogram

Other
98 stars 32 forks source link

Unable to analysis new video #131

Open thallus1208 opened 1 year ago

thallus1208 commented 1 year ago

I have been trying this tool for a few days now. It doesn't analyze new videos. I used downloaded the videos that were used in the paper.

When I trained the video " f"You requested GPUs: {gpus}\n But your machine only has: {all_available_gpus}" pytorch_lightning.utilities.exceptions.MisconfigurationException: You requested GPUs: [0] But your machine only has: [] [2023-02-22 16:33:31,081] INFO [deepethogram.gui.main.featureextractor_train:395] Training finished. If you see error messages above, training did not complete successfully. [2023-02-22 16:33:31,081] INFO [deepethogram.gui.main.featureextractor_train:400]" Does it mean it trains successfully as I don't see the error message? Or it didn't train because of the GPU issue.

When I pressor infer Here is the error message I got " assert os.path.isfile(loaded_config_file), 'no associated config file for weights! {}'.format(weightfile) AssertionError: no associated config file for weights! C:\Users\ya22742\OneDrive - University of Bristol\Desktop\test again\try1\attempt2_deepethogram\models\pretrained_models\200415_125824_hidden_two_stream_kinetics_degf\checkpoint.pt [2023-02-22 16:26:21,409] INFO [deepethogram.gui.main.featureextractor_infer:463] Inference finished. If you see error messages above, inference did not complete successfully. [2023-02-22 16:26:21,410] INFO [deepethogram.gui.main.featureextractor_infer:468] "

I can't get the sequence function to light up as I can't even get the infer function to work.

I would appreciate that if I can get help to resolve the issue and get this tool to work. Thank you

gibbont2 commented 1 year ago

Hey, Not affiliated with this project but I have been working with it a lot over the past couple of weeks so take this with a grain of salt.

" f"You requested GPUs: {gpus}\n But your machine only has: {all_available_gpus}"
pytorch_lightning.utilities.exceptions.MisconfigurationException: You requested GPUs: [0]
But your machine only has: []
[2023-02-22 16:33:31,081] INFO [deepethogram.gui.main.featureextractor_train:395] Training finished. If you see error messages above, training did not complete successfully.
[2023-02-22 16:33:31,081] INFO [deepethogram.gui.main.featureextractor_train:400]"

This means that training did not proceed successfully. Training will take a decent chunk of time to complete. It appears that you're getting an error message when you initialize training - it never starts successfully.

I think you're having an issue with pytorch recognizing your GPU. Does your system have a GPU? GPU [0] is the first GPU recognized in your system. I believe "your machine only has: []" means that it does not recognize a usable GPU. If you have nvidia GPU and are on windows, try removing +reinstalling pytorch and follow some of those trouble shooting steps. On linux, I had to install Cuda toolkit and do some troubleshooting there in order for pytorch to properly recognize my gpu.

vbalog commented 1 year ago

Hey, I am also getting the "AssertionError: no associated config file for weights!" error. I was able to train the FlowGenerator successfully, but attempting to infer or train the FeatureExtractor isn't going well.

Here is the output when I attempt to "train": Traceback (most recent call last): File "C:\Users\Bizon\.conda\envs\deg2\lib\runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "C:\Users\Bizon\.conda\envs\deg2\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "C:\Users\Bizon\.conda\envs\deg2\lib\site-packages\deepethogram\feature_extractor\train.py", line 646, in <module> feature_extractor_train(cfg) File "C:\Users\Bizon\.conda\envs\deg2\lib\site-packages\deepethogram\feature_extractor\train.py", line 85, in feature_extractor_train input_images=cfg.feature_extractor.n_flows + 1) File "C:\Users\Bizon\.conda\envs\deg2\lib\site-packages\deepethogram\data\datasets.py", line 1186, in get_datasets_from_cfg mean_by_channels=cfg.augs.normalization.mean) File "C:\Users\Bizon\.conda\envs\deg2\lib\site-packages\deepethogram\data\datasets.py", line 934, in get_video_datasets mean_by_channels=mean_by_channels) File "C:\Users\Bizon\.conda\envs\deg2\lib\site-packages\deepethogram\data\datasets.py", line 403, in __init__ self.dataset = data.ConcatDataset(datasets) File "C:\Users\Bizon\.conda\envs\deg2\lib\site-packages\torch\utils\data\dataset.py", line 290, in __init__ assert len(self.datasets) > 0, 'datasets should not be an empty iterable' # type: ignore[arg-type] AssertionError: datasets should not be an empty iterable

And the output when I attempt to "infer"

Traceback (most recent call last): File "C:\Users\Bizon\.conda\envs\deg2\lib\runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "C:\Users\Bizon\.conda\envs\deg2\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "C:\Users\Bizon\.conda\envs\deg2\lib\site-packages\deepethogram\feature_extractor\inference.py", line 586, in <module> feature_extractor_inference(cfg) File "C:\Users\Bizon\.conda\envs\deg2\lib\site-packages\deepethogram\feature_extractor\inference.py", line 523, in feature_extractor_inference run_files = utils.get_run_files_from_weights(feature_extractor_weights) File "C:\Users\Bizon\.conda\envs\deg2\lib\site-packages\deepethogram\utils.py", line 846, in get_run_files_from_weights assert os.path.isfile(loaded_config_file), 'no associated config file for weights! {}'.format(weightfile) AssertionError: no associated config file for weights! C:\Users\Bizon\Desktop\Valerie DeepEthogram Video CFC Testing\VB_DE_Try3\CFC-Cohort1_deepethogram\models\pretrained_models\200415_125824_hidden_two_stream_kinetics_degf\checkpoint.pt [2023-03-22 20:46:10,817] INFO [deepethogram.gui.main.featureextractor_infer:463] Inference finished. If you see error messages above, inference did not complete successfully.

Any help or workarounds would be greatly appreciated!

ycwei0321 commented 1 year ago

I also have this issue that my pytorch can't recognize my GPU. I checked my computer, there are two GPUs. I also tried the way you suggested with removing + reinstalling pytorch, but it still has such issue. Do you have any suggestions for this? I run this on Window. Thanks.