googlecreativelab / teachablemachine-community

Example code snippets and machine learning code for Teachable Machine
https://g.co/teachablemachine
Apache License 2.0
1.5k stars 666 forks source link

ValueError: Unknown layer: Functional #193

Open snehitvaddi opened 3 years ago

snehitvaddi commented 3 years ago

I have downloaded the trained Tensorflow Keras model from Teachable Machine. I tried running the model on my local system with the sample code given by Teachable Machine, and I'm facing this issue.

I have upgraded my Tensorflow to the latest version and still reproducing the same issue.

Code Screenshot Capture

System Configuration:

Suggestion Team @teachablemachine would be convenient if you can include a config/requirements file while downloading the saved model.

Gopu2001 commented 3 years ago

I had the same error when I was running using PowerShell on Windows, but after some environment changes, I was able to get the model to work. I would suggest running in WSL by typing wsl in the PowerShell command line, then, if you haven't installed the required Python 3 libraries, you need to ensure that you install the following packages: Keras (v2.4.3) matplotlib (v3.3.4) numpy (v1.19.5) Pillow (v8.2.0) tensorflow (v2.4.1) There are definitely more packages, but most likely Python pip will handle the dependencies. Otherwise, Google can help you when you get a ModuleNotFoundError.

tonystark12 commented 3 years ago

The issue is with the version mismatch between tf and keras.. To correct this, we would need to know the version of tf andkeras,with which the modelis exported in Teachable. For further insights,

https://stackoverflow.com/questions/63068639/valueerror-unknown-layer-functional