Тёмный

How to deploy your custom tensorflow model to the web (Part 1) 

Oh Yicong
Подписаться 1,7 тыс.
Просмотров 18 тыс.
50% 1

This is a short tutorial to teach you how to convert your tensorflow/keras model into web format (convert .h5 to JSON). So that you are able to deploy your trained model on any website!
Link to my mask detection website: masks-detection-13237.web.app
Link to my github code: github.com/ohyicong/masksdete...
Code to convert .h5 to JSON:
tensorflowjs_converter --input_format=keras C:/insert_path_to_h5 C:/insert_path_to_js_model_folder

Наука

Опубликовано:

 

5 сен 2020

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 64   
@angelortiz3564
@angelortiz3564 2 года назад
This is by far one of the best resources I have seen on this topic. Thank you.
@chirpieful
@chirpieful 2 года назад
Thanks for your kind words
@victormaina9719
@victormaina9719 2 года назад
Awesome tutorial , thanks
@rakotoniainaherifanirymois4637
@rakotoniainaherifanirymois4637 2 года назад
I needed this !! thanks
@prasanthtr5693
@prasanthtr5693 2 года назад
Excellent
@joafin19
@joafin19 Год назад
thank you for sharing.
@gary3223
@gary3223 3 года назад
Thank you :)
@gihankaushalya2999
@gihankaushalya2999 2 года назад
Can you explain what is this error raise ValueError("mismatch between the number of fields " ValueError: mismatch between the number of fields and the number of arrays
@zhionn6626
@zhionn6626 2 года назад
Hiii, can u teach me how to do for object detection?
@dinakarreddy9196
@dinakarreddy9196 3 года назад
sir, can you explain me ,what does the activate datascience command do
@chirpieful
@chirpieful 3 года назад
I'm using my anaconda environment named data science. if you are using the default environment, you do not need to type that.
@diegocaumont5677
@diegocaumont5677 3 года назад
Thanks :)
@chirpieful
@chirpieful 3 года назад
Glad that I helped :)
@chirpieful
@chirpieful 3 года назад
@@arivukkuvirunthu9502 Just uploaded :)
@dhruvkartik5955
@dhruvkartik5955 3 года назад
Hi, I managed to get the server running locally but mask detection is not working .There is nothing coming on the face. I have loaded the model file correctly Please Help
@chirpieful
@chirpieful 3 года назад
It may take 3-5mins to load the model. is it working now?
@teesayjin2318
@teesayjin2318 3 года назад
Hi ,may I know is the html code applicable for other Json model ? I have my own .h5 model and wondering will it be compatible.. thanks in advance :)
@chirpieful
@chirpieful 3 года назад
Hi you have to convert the h5 file to json as shown in the tutorial
@teesayjin2318
@teesayjin2318 3 года назад
@@chirpieful yes,I just realized u preprocessed the image data based on mobilenet ..I am not using mobilenet ,so definitely I can’t use ur html ,right ? Sorry I am new in this ._.
@chirpieful
@chirpieful 3 года назад
@@teesayjin2318 you can import mobilenet from tensorflowjs. Otherwise you can also convert mobilenet into JSON model.
@teesayjin2318
@teesayjin2318 3 года назад
@@chirpieful understood :) thanks !
@AbhishekPatel-bo1tx
@AbhishekPatel-bo1tx 3 года назад
can you update your code for react js also, you have done it on HTML it's really good, but I wanna know how it runs on react js?
@chirpieful
@chirpieful 3 года назад
I have did a video on how to deploy on react native, do take a look.
@ExplaineRKhaN
@ExplaineRKhaN 3 года назад
hello sir face this error , line 660, in load_weights_from_hdf5_group original_keras_version = f.attrs['keras_version'].decode('utf8') AttributeError: 'str' object has no attribute 'decode'
@chirpieful
@chirpieful 3 года назад
Please download the correct packages. Check if you are using tensorflow v2.
@ExplaineRKhaN
@ExplaineRKhaN 3 года назад
@@chirpieful thanks can you have a Facebook group or id. I ll talk easily
@TarunKrishnanextra
@TarunKrishnanextra 3 года назад
Hey! The detection model is not working once it gets deployed on the local browser even after 3-5 minutes just like you said, only the webcam footage gets shown , please help
@chirpieful
@chirpieful 3 года назад
Mhmm... are you using chrome? I only test my code on chrome browser.
@TarunKrishnanextra
@TarunKrishnanextra 3 года назад
Yep , so I tried a model thst I had a made and that didn't work , later I tried ur model and that also didn't end up working on Chrome
@chirpieful
@chirpieful 3 года назад
@@TarunKrishnanextra mhmm.. it should work. you can check by visiting masks-detection-13237.web.app/
@TarunKrishnanextra
@TarunKrishnanextra 3 года назад
@@chirpieful oh sweet its working now xD So it might have not worked cause of interference from another app that was running ( zoom in my case ) . Will try looking at the next part now :p
@axyshaysi
@axyshaysi 3 года назад
Thank you. I want to make a simple gui for object detection with pre-trained Tensorflow.js file. How to do it? Can you make a video?
@chirpieful
@chirpieful 3 года назад
Hi, what do you mean?
@axyshaysi
@axyshaysi 3 года назад
@@chirpieful With my pictures i made a model on google teachable machine website. I can download my model as Tensorflow.js. I want to make a simple desktop application for pc with my model. Just browse a photo and it should show you which classification.
@chirpieful
@chirpieful 3 года назад
@@axyshaysi hi you can download your model as JSON, and follow my part 2 tutorial. It should work.
@axyshaysi
@axyshaysi 3 года назад
@@chirpieful thank you very much. İ will try 👏🏿👏🏿👏🏿
@mikailmohamed3478
@mikailmohamed3478 2 года назад
@@axyshaysi did it work?
@annanyamathur8869
@annanyamathur8869 3 года назад
Sir I am getting error in as tensorflowjs_converter not found , can you please help?
@chirpieful
@chirpieful 3 года назад
did you download the package?
@annanyamathur8869
@annanyamathur8869 3 года назад
@@chirpieful yes
@chirpieful
@chirpieful 3 года назад
@@annanyamathur8869 if that's the case, I suspect you are not using tensor flow 2.0. hence it resulted in a compatibility issue.
@annanyamathur8869
@annanyamathur8869 3 года назад
@@chirpieful Ohk I will see it
@janardlagdameo9161
@janardlagdameo9161 2 года назад
Got this error, can you please help Uncaught (in promise) TypeError: Cannot read properties of null (reading 'model_config')
@chirpieful
@chirpieful 2 года назад
The model file is missing?
@chirpieful
@chirpieful 2 года назад
Check your file path
@janardlagdameo9161
@janardlagdameo9161 2 года назад
i tried using my own trained model and it shows that error. However, if i use your trained model and it worked completely fine.
@amirulhakimbinabdulrahmanu3761
@amirulhakimbinabdulrahmanu3761 2 года назад
if i have 5 class, how to change the code?
@chirpieful
@chirpieful 2 года назад
You need to change the input/output layer from 2 to 5
@amirulhakimbinabdulrahmanu3761
@amirulhakimbinabdulrahmanu3761 2 года назад
i have an issue , i already have the model for 5 class (json and .h5) but the problem is i dont know the right way to replace my model in to ur program to make the web can classify 5 class
@salaheddineaboulkacim7133
@salaheddineaboulkacim7133 2 года назад
I have the same problem so please if you fixe the problem tell me on this comment
@devanshsrivastava7439
@devanshsrivastava7439 3 года назад
When i load the website. It takes 12-15 seconds to give the detection. How to fix this?
@chirpieful
@chirpieful 3 года назад
You can install it locally on your computer so you can save the downloading time.
@devanshsrivastava7439
@devanshsrivastava7439 3 года назад
@@chirpieful i have uploaded my own model in json format on 000.webhost.com. And i am calling that in the index.html
@chirpieful
@chirpieful 3 года назад
@@devanshsrivastava7439 yupp, you may consider refactoring the code. So that you are able to download and save the JSON file locally. So the load time will be faster next time.
@devanshsrivastava7439
@devanshsrivastava7439 3 года назад
@@chirpieful okay but i can't figure it out how 😬😬 I had another question. We have blazeface.js save in system. But why are we calling it from link???
@devang5070
@devang5070 2 года назад
I dont understand how you got that datascience environemnt
@chirpieful
@chirpieful 2 года назад
You can use your own environment. You can skip this command, if you are using the default environment.
@devang5070
@devang5070 2 года назад
@@chirpieful Can you please tell how to do it. I am stuck here. The way I was trying I am getting this error, Module 'tensorflow.tools.docs.doc_control' has no attribute 'inheritable header'
@jonatan6105
@jonatan6105 3 года назад
HI yicong i am mexican i only want to go ahead in my life, I want to do a machine that classify the walnuts and stones its to filtering the nuts from the stones, and clasify the 3 kinds of nuts(1-nut that are open, 2 walnuts that are cracked, and walnuts that have yet the shield) please can u help and guiding me, God will pay u, thanks u
@bharatreddy9342
@bharatreddy9342 Год назад
I am getting this error while invoking the model - Could not load dynamic library 'libcudart.so.11.0'' dlerror: libcudart.so.11.0: How do I get over this problem?
@chirpieful
@chirpieful Год назад
Are you using linux?
@bharatreddy9342
@bharatreddy9342 Год назад
@@chirpieful Yes. How do I fix this issue?
@chirpieful
@chirpieful Год назад
@@bharatreddy9342 I didn't test the code on linux system. So there might be some compatibility issue.
Далее
Deploy ML model in 10 minutes. Explained
12:41
Просмотров 13 тыс.
🎙ПЕСНИ ВЖИВУЮ от КВАШЕНОЙ🌇
3:16:26
The New AI Side Hustle That's Making $1,579+/Day
17:50
the truth about ChatGPT generated code
10:35
Просмотров 220 тыс.
Deploy Machine Learning Models using Flask
14:52
Просмотров 110 тыс.
The moment we stopped understanding AI [AlexNet]
17:38
Просмотров 830 тыс.
Face Detection in the Browser using Tensorflow.js
12:26
АЙФОН Г0ВН0
0:54
Просмотров 1,7 млн
КРУТОЙ ТЕЛЕФОН
0:16
Просмотров 6 млн
Проверил, как вам?
0:58
Просмотров 240 тыс.