VIPL-SLP / VAC_CSLR

Visual Alignment Constraint for Continuous Sign Language Recognition. ( ICCV 2021)
https://openaccess.thecvf.com/content/ICCV2021/html/Min_Visual_Alignment_Constraint_for_Continuous_Sign_Language_Recognition_ICCV_2021_paper.html
Apache License 2.0
116 stars 19 forks source link

Torch not compiled with CUDA enabled #28

Open ethio-artifical opened 1 year ago

ethio-artifical commented 1 year ago

hello, how are guys

i try this code but my machine don't have GPU service enabled So, please give me the solution how to try with out CUDA

the error is :

File "F:\code\VAC_CSLR-main\main.py", line 209, in processor = Processor(args) File "F:\code\VAC_CSLR-main\main.py", line 34, in init self.model, self.optimizer = self.loading() File "C:\Users\ANTENEH\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\torch\cuda__init__.py", line 221, in _lazy_init raise AssertionError("Torch not compiled with CUDA enabled") AssertionError: Torch not compiled with CUDA enabled

this is the error that How Can I test in CPU???

ycmin95 commented 1 year ago

@ethio-artifical You just need to comment model.cuda() line in main.py, and modify the pre-trained load process in main.py to state_dict = torch.load(weight_path, map_location=torch.device('cpu')).

The command to evaluate the pre-trained model on CPU is: python main.py --load-weights resnet18_slr_pretrained.pt --phase test --device None

ethio-artifical commented 1 year ago

Tnx for the replay

Can you help please i got the error again i am beginner and i stuck on this please if you can help me

i got this error when i run this

F:\code\VAC_CSLR-MAIN> python main.py --work-dir F:\code\VAC_CSLR-main\work_dir\baseline_res18 --config F:\code\VAC_CSLR-main\configs\baseline.yaml --device 0 .git does not exist in current dir [ Fri Mar 10 23:55:28 2023 ] Parameters: lr_network.SLRModel', 'model_args': {'num_classes': 508, 'c2d_type': 'resnet18', 'conv_type': 2, 'use_bn': 1, 'share_classifier': False, 'weight_norm': False}, 'load_weights': None, 'load_checkpoints': None, 'decode_mode': 'beam', 'ignore_weights': [], 'batch_size': 2, 'test_batch_size': 8, 'loss_weights': {'SeqCTC': 1.0}, 'optimizer_args': {'optimizer': 'Adam', 'base_lr': 0.0001, 'step': [20, 35], 'learning_ratio': 1, 'weight_decay': 0.0001, 'start_epoch': 0, 'nesterov': False}, 'num_epoch': 3} starting trainingTraceback (most recent call last): File "F:\code\VAC_CSLR-MAIN\main.py", line 215, in processor.start() File "F:\code\VAC_CSLR-MAIN\main.py", line 44, in start seq_train(self.data_loader['train'], self.model, self.optimizer, KeyError: 'train'

[image: Mailtrack] https://mailtrack.io?utm_source=gmail&utm_medium=signature&utm_campaign=signaturevirality11& Sender notified by Mailtrack https://mailtrack.io?utm_source=gmail&utm_medium=signature&utm_campaign=signaturevirality11& 03/10/23, 11:56:25 PM

On Wed, Mar 8, 2023 at 7:58 AM Yuecong Min @.***> wrote:

You just need to comment model.cuda() line in main.py https://github.com/ycmin95/VAC_CSLR/blob/main/main.py#L118, and modify the pre-trained load process in main.py https://github.com/ycmin95/VAC_CSLR/blob/main/main.py#L122 to state_dict = torch.load(weight_path, map_location=torch.device('cpu')).

The command to evaluate the pre-trained model on CPU is: python main.py --load-weights resnet18_slr_pretrained.pt --phase test --device None

— Reply to this email directly, view it on GitHub https://github.com/ycmin95/VAC_CSLR/issues/28#issuecomment-1459485754, or unsubscribe https://github.com/notifications/unsubscribe-auth/AXWRMVTXK3Y3HUGO3WOS73LW3AGY7ANCNFSM6AAAAAAVTCKHGU . You are receiving this because you authored the thread.Message ID: @.***>