Video 49. Making Predictions With Our Random Model Using Inference Mode - no attribute 'inference' #679
Answered
by
mrdbourke
slawomirwojtas
asked this question in
Q&A
-
AttributeError: module 'torch' has no attribute 'inference' The torch version is 2.0.1+cu118
|
Beta Was this translation helpful? Give feedback.
Answered by
mrdbourke
Oct 13, 2023
Replies: 1 comment 1 reply
-
Hi @slawomirwojtas , A slight correction to your code. Your code: # Make predictions with model
with torch.inference.mode():
y_preds = model_0(X_test) Fixed: # Make predictions with model
with torch.inference_mode():
y_preds = model_0(X_test) Notice the |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
mrdbourke
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @slawomirwojtas ,
A slight correction to your code.
Your code:
Fixed:
Notice the
torch.inference.mode()
->torch.inference_mode()
, it's an_
rather than.
.