Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gpu error #41

Open
88nihal opened this issue Sep 7, 2024 · 1 comment
Open

gpu error #41

88nihal opened this issue Sep 7, 2024 · 1 comment

Comments

@88nihal
Copy link

88nihal commented Sep 7, 2024

[07/Sep/2024 13:43:11] "GET / HTTP/1.1" 200 5233
[07/Sep/2024 13:43:11] "GET /static/bootstrap/bootstrap.min.css HTTP/1.1" 304 0
[07/Sep/2024 13:43:11] "GET /static/css/jquery-ui.css HTTP/1.1" 304 0
[07/Sep/2024 13:43:11] "GET /static/css/styles.css HTTP/1.1" 304 0
[07/Sep/2024 13:43:11] "GET /static/images/logo1.png HTTP/1.1" 304 0
[07/Sep/2024 13:43:11] "GET /static/js/jquery-3.4.1.min.js HTTP/1.1" 304 0
[07/Sep/2024 13:43:11] "GET /static/js/popper.min.js HTTP/1.1" 304 0
[07/Sep/2024 13:43:11] "GET /static/js/jquery-ui.min.js HTTP/1.1" 304 0
[07/Sep/2024 13:43:11] "GET /static/js/script.js HTTP/1.1" 304 0
[07/Sep/2024 13:43:11] "GET /static/images/background1.png HTTP/1.1" 304 0
Not Found: /favicon.ico
[07/Sep/2024 13:43:11] "GET /favicon.ico HTTP/1.1" 404 2813
[07/Sep/2024 13:43:33] "POST / HTTP/1.1" 302 0
D:\Deepfake_detection_using_deep_learning\Django Application\venv\Lib\site-packages\torchvision\models_utils.py:208: UserWarning: The parameter 'pretrained' is deprecated since 0.13 and may be removed in the future, please use 'weights' instead.
warnings.warn(
D:\Deepfake_detection_using_deep_learning\Django Application\venv\Lib\site-packages\torchvision\models_utils.py:223: UserWarning: Arguments other than a weight enum or None for 'weights' are deprecated since 0.13 and may be removed in the future. The current behavior is equivalent to passing weights=ResNeXt50_32X4D_Weights.IMAGENET1K_V1. You can also use weights=ResNeXt50_32X4D_Weights.DEFAULT to get the most up-to-date weights.
warnings.warn(msg)
D:\Deepfake_detection_using_deep_learning\Django Application\ml_app\views.py:288: FutureWarning: You are using torch.load with weights_only=False (the current default value), which uses the default pickle module implicitly. It is possible to construct malicious pickle data which will execute arbitrary code during unpickling (See https://github.com/pytorch/pytorch/blob/main/SECURITY.md#untrusted-models for more details). In a future release, the default value for weights_only will be flipped to True. This limits the functions that could be executed during unpickling. Arbitrary objects will no longer be allowed to be loaded via this mode unless they are explicitly allowlisted by the user via torch.serialization.add_safe_globals. We recommend you start setting weights_only=True for any use case where you don't have full control of the loaded file. Please open an issue on GitHub for any issues related to this experimental feature.
model.load_state_dict(torch.load(path_to_model, map_location=torch.device('cpu')))
<=== | Started Videos Splitting | ===>
Number of frames: 297
<=== | Videos Splitting and Face Cropping Done | ===>
--- 0.48983168601989746 seconds ---
<=== | Started Prediction | ===>
Exception occurred during prediction: Expected one of cpu, cuda, ipu, xpu, mkldnn, opengl, opencl, ideep, hip, ve, fpga, maia, xla, lazy, vulkan, mps, meta, hpu, mtia, privateuseone device type at start of device string: gpu
[07/Sep/2024 13:43:37] "GET /predict/ HTTP/1.1" 200 23420

@Quanxuecoding
Copy link

change the device=='gpu' in 'views.py' to device == 'cuda'. gpu is not a device choice in pytorch, you need change all the two 'gpu' in that document to 'cuda'. Then you re-run the programme, you will find that's ok.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants