super-gradients icon indicating copy to clipboard operation
super-gradients copied to clipboard

RuntimeError: Input type (unsigned char) and bias type (float) should be the same

Open Satyajit1993 opened this issue 1 year ago • 4 comments

After running the below code for predicting a single image I got this error

test_image = '08927.jpg' best_model.predict(test_image).show()

RuntimeError: Input type (unsigned char) and bias type (float) should be the same

Satyajit1993 avatar May 24 '23 05:05 Satyajit1993

Can you please provide a bit more context? What is best_model and how you instantiated it? If there is a link to Colab notebook that we can try to reproduce the issue it would help to address your issue in timely manner.

BloodAxe avatar May 24 '23 06:05 BloodAxe

@Satyajit1993 I have had the same problem, it seems to be a bug with the new versions. In my case at least, setting the version to 3.1.1 (pip install super-gradients==3.1.1) fixes the problem in inference. Also, models trained with higher versions of the library are backward compatible (at least in inference) so, even if you train a model with a higher version, you will be able to do inference with 3.1.1.

CuarteroAlvaro avatar May 30 '23 08:05 CuarteroAlvaro

This solved it. The version with which I trained was 3.1.2 , after creating a separate environment with 3.1.1 it started working! Will try to check if there is something more to this, or is it a bug.

skyprince999 avatar Jun 11 '23 18:06 skyprince999