hii @nvidias
I am trying to load an classification engine model in python script and pass an image directory which contains sub-folders (sub-folders are different classes) after running the script getting error:
Traceback (most recent call last):
File “infer_resnet18_classification.py”, line 116, in
test_case = load_normalized_test_case(test_image, h_input)
File “infer_resnet18_classification.py”, line 59, in load_normalized_test_case
np.copyto(pagelocked_buffer, normalize_image(Image.open(test_image)))
File “infer_resnet18_classification.py”, line 50, in normalize_image
image_arr = np.asarray(image.resize((w, h), Image.ANTIALIAS)).transpose([2, 0, 1]) .astype(trt.nptype(trt.float32)).ravel()
ValueError: axes don’t match array
I am attaching my scrip here
infer_resnet18_classification.py (5.0 KB)
Any help will be appreciable
thanks