Why do I get “TypeError: expected np.ndarray (got numpy.ndarray)”  when I use torch.from_numpy() function? Isn’t np.ndarray equivalent to numpy.ndarray? Also, there doesn’t seem to be any np.ndarray type, but only numpy.ndarray type.
Traceback (most recent call last): File "test_opencv.py", line 31, in <module> bounding_boxes, landmarks = detect_faces(img, pnet, rnet, onet) File "/home/xxx/git/project/src/detector.py", line 67, in detect_faces boxes = run_first_stage(image, pnet, scale=s, threshold=thresholds[0]) File "/home/xxx/git/project/src/first_stage.py", line 73, in run_first_stage img = torch.from_numpy(img).unsqueeze(0).permute(0,3,1,2).cuda().float() TypeError: expected np.ndarray (got numpy.ndarray)