frame_str = base64.b64decode(input_data[“frame1”])
frame = torch.Tensor(resize(jpeg.decode(frame_str),(640,640))).permute(2,0,1)
frame = frame
predictions = model.predict(frame)
boxes = numpy.asarray(predictions[0][‘boxes’])
print(“Converted Predictions to numpy format - %s” %(type(boxes)))
print(“Predictions %s” %(predictions))
if isinstance(boxes, list):
boxes = np.array(boxes)
boxes = boxes.astype("int")
TypeError: can’t convert cuda:0 device type tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory first.
i’m getting this error ,what am i doing wrong?