i also write code properly and some times i am copying form this code but always shows the AttributeError: 'numpy.ndarray' object has no attribute 'to' #568
Unanswered
vivek152oo3
asked this question in
Q&A
Replies: 1 comment
-
Hi, |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
/# Make predictions with the model
untrained_preds = model_0(X_test.to(device))
print(f"Length of predictions: {len(untrained_preds)}, Shape: {untrained_preds.shape}")
print(f"Length of test samples: {len(y_test)}, Shape: {y_test.shape}")
print(f"\nFirst 10 predictions:\n{untrained_preds[:10]}")
print(f"\nFirst 10 test labels:\n{y_test[:10]}")
output
AttributeError Traceback (most recent call last)
in <cell line: 2>()
1 # Make predictions with the model
----> 2 untrained_preds = model_0(X_test.to(device))
3 print(f"Length of predictions: {len(untrained_preds)}, Shape: {untrained_preds.shape}")
4 print(f"Length of test samples: {len(y_test)}, Shape: {y_test.shape}")
5 print(f"\nFirst 10 predictions:\n{untrained_preds[:10]}")
AttributeError: 'numpy.ndarray' object has no attribute 'to'
i am dont understand what type error
![Uploading Screenshot 2023-07-25 164515.png…]()
Beta Was this translation helpful? Give feedback.
All reactions