Cannot access Web model in my app

I have trained my model in Google Colab and deployed it back to Roboflow. The model is available on the project page, I can test it with images and it seems to work fine. However, when I try to use it in my web app, I get the following error:

“Could not parse size from model.json”
“You must train a model on this version with Roboflow Train before you can use inference.”
“No trained model was found for this model version.”
“GraphMethodException”

roboflow error

roboflow.auth({
    publishable_key: "xxxxx" 
}).load({
   model: "4f5c22f2-3b54-4f90-ad68-87d083bc1baf",
    version: 20 
}).then(function(model) {
    console.log("model has loaded");
});

It is a YOLOv5 model, up to a few weeks ago this process worked fine. Colab seems to have upgraded some libraries and now the tensorflowjs conversion fails. Downgrading jax and jaxlib and reinstalling tensorflowjs allows me to do the conversion but it gives a lot of warnings:

WARNING:tensorflow:Didn't find expected Conv2D or DepthwiseConv2dNative input to 'model/tf_bottleneck_csp/tfbn/batch_normalization/FusedBatchNormV3'
WARNING:tensorflow:Didn't find expected Conv2D or DepthwiseConv2dNative input to 'model/tf_bottleneck_csp_1/tfbn_1/batch_normalization_1/FusedBatchNormV3'
WARNING:tensorflow:Didn't find expected Conv2D or DepthwiseConv2dNative input to 'model/tf_bottleneck_csp_2/tfbn_2/batch_normalization_2/FusedBatchNormV3'
WARNING:tensorflow:Didn't find expected Conv2D or DepthwiseConv2dNative input to 'model/tf_bottleneck_csp_3/tfbn_3/batch_normalization_3/FusedBatchNormV3'
WARNING:tensorflow:Didn't find expected Conv2D or DepthwiseConv2dNative input to 'model/tf_bottleneck_csp_4/tfbn_4/batch_normalization_4/FusedBatchNormV3'
WARNING:tensorflow:Didn't find expected Conv2D or DepthwiseConv2dNative input to 'model/tf_bottleneck_csp_5/tfbn_5/batch_normalization_5/FusedBatchNormV3'
WARNING:tensorflow:Didn't find expected Conv2D or DepthwiseConv2dNative input to 'model/tf_bottleneck_csp_6/tfbn_6/batch_normalization_6/FusedBatchNormV3'
WARNING:tensorflow:Didn't find expected Conv2D or DepthwiseConv2dNative input to 'model/tf_bottleneck_csp_7/tfbn_7/batch_normalization_7/FusedBatchNormV3'

I suspect this is why the web model is corrupted.

I’m running Chrome on Ubuntu 22.04
https://app.roboflow.com/itgisworx/4f5c22f2-3b54-4f90-ad68-87d083bc1baf/deploy/20

Can the web model not be generated at Roboflow in stead of in the Colab notebook?

I’ll just answer my own question.

I downgraded the following packages:

!pip install tensorflow==2.14.0
!pip install tensorboard==2.14.0
!pip install keras==2.14.0
!pip install tensorflow-gcs-config==2.14.0
!pip install pyarrow==9.0.0
!pip install jax==0.4.20
!pip install jaxlib==0.4.20

Then after training the model, I installed tensorflowjs:

!pip install tensorflowjs==4.14.0

Then did the conversion without any errors:

!python export.py --weights /content/yolov5/runs/train/yolov5s_results/weights/best.pt --include tfjs

And finally deployed it to Roboflow as usual.
Now the Web model pulls through without issue to my app.

1 Like

Hi @MainBearing

Sorry to hear you were having trouble. Thank you for sharing your experience and how to resolve this issue!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.