wafa_ath
DIIDevHeads IoT Integration Server
•Created by wafa_ath on 7/19/2024 in #middleware-and-os
Issue with 4-Dimensional Input Error in PyTorch Model Inference
Hello everyone, I'm working on an object recognition project using PyTorch in Python, and I'm encountering an issue with model inference. After successfully training my model, I'm getting an error during inference:
Error: RuntimeError: Expected 4-dimensional input for 4-dimensional weight [32, 3, 3, 3], but got 3-dimensional input of size [3, 224, 224] instead.
I'm using a pre-trained ResNet model and passing in images of size 224x224 pixels. Any ideas on why this error is occurring and how I can resolve it? Your insights would be much appreciated
@Middleware & OS
6 replies