Time limit training locally? BYOM confusion

Dear Edge Impulse Team.
I’ve been enthusiastically digging and exploring your platform for the last days until I’ve realized this HUGE problem
I’m trying to train my model locally (exported from Edit block locally) and building/running the docker like suggested in the README but, with my big surprise (and disappointment), it still complains
ERR: Estimated training time (1h 29m 30s) is larger than compute time limit (20m 0s).

I’ve read the brief docs about BYOM but this means I’ve to start from scratch or I can use the model settings prepared in the studio and downloaded??? There is almost no useful information there on how to do it.
Can I use the code exported from Edit block locally to train locally with no restrictions yes or no?
I really hope is yes and I’ve missed some docs and I can take advantage of the great pipeline that you’ve made, and likewise I can use my local compute resources.

Project ID:
Context/Use case:
This is the fist research phase, for a CV project I’m doing for the University of Bologna (Italy),
field: Precise and Sustainable Agriculture.
We aim to successfully estimate the weight of the crop, collected in a conveyor belt using image regression.
The current dataset comprise of 1000+ synthetic generated images with corresponding labels representing the number of “balls” tossed in the rigid-body simulation (blender).
This is just the very first try, but we plan to use many more sample, with possible increased resolutions/image quality and, of course, real images at harvesting time.

1 Like

Some additional context (and confusion)
I’ve read https://edge-impulse.gitbook.io/docs/edge-impulse-studio/learning-blocks/adding-custom-learning-blocks
I’ve run

$ edge-impulse-blocks init
$ docker run --rm -v $PWD:/scripts custom-learning-block --data-directory data/ --epochs 300 --learning-rate 0.01 --out-directory out/
# changed parameters.json 
# trained the files are in out/
$ ls out
model.h5.zip  model_quantized_int8_io.tflite  model.tflite  saved_model  saved_model.zip
$ edge-impulse-blocks push

I’ve imported the new custom block in my project with studio’s wizard.
The new block appears NOT TRAINED

So after lowering the epoch to 300 I was able to train locally, (I’m still worried about this limit) but the local training is not uploaded???

I hope some of the team can help me out, this is my third attempt to message the forum with no reply

1 Like

Hi @diramazioni

Interesting project, we love blender here too, and could use some better examples for sure. I’ll try to follow through your workflow.

Can you share the pipeline / notebook / gitrepo you are working from? I’ll check with the team on the steps that are missing and get back to you.

Failed to create job: Transfer learning model “ei-synth” cannot be exported
Custom learning blocks can be modified locally from the same local directory it was initially pushed from on your system, or re-clone the remote repository it is stored in, and then re-push your updated block with the Edge Impulse CLI



Hi Eoin, thanks for getting back to me, my question is simple:
How to upload an already trained model?
I’ve both

  • exported from Edit block locally trained locally and try to import back back and it’s still untrained (as the picture above)
  • recreated a notebook from scratch using tensorflow and trained (haven’t try to upload yet)

Hi @diramazioni

OK so the main problem is getting the trained model output in the correct format to get recognised as it is trained once it is uploaded to your project.

Did you try to follow the BYOM doc? Your model must have a single input tensor and a single output tensor. After training and evaluating your model, then bundle it in a zip.

  1. Input and Output Tensors: The model should have a single input tensor and a single output tensor. For image models, the input tensor typically has a shape that includes the batch size, height, width, and channels (e.g., [1, height, width, channels]), and the output tensor shape (e.g., [1, 1] for a single regression output).
  2. Export and Zip your trained model: If using a TensorFlow SavedModel, the directory containing the saved_model.pb file and variables directory should be zipped something like this.
# Save the trained model

# Zip the saved model directory for upload
!zip -r my_model.zip . /my_model/

If you’re still having trouble I will check with the tech team to see if there is anything we are missing.



Hello @diramazioni,

From what I’m seeing, you are trying to upload your model architecture instead of your model (Bring your own model (BYOM) | Edge Impulse Documentation).

recreated a notebook from scratch using tensorflow and trained (haven’t try to upload yet)

Just upload your model:
Create a new project, then, from the Dashboard of your Edge Impulse project under “Getting started”, select Upload your model.