google-aiy

How to remove layers from a keras model in order to use as baseline for creating another model

五迷三道 提交于 2021-02-18 19:11:14
问题 I need to use a pre-trained model in Keras(keras.applications.VGG16) as a baseline for creating another model(for doing transfer learning) from the first layers of it. The end goal is to freeze and export the model for deployment on a raspberry pi with AIY vision kit. I've tried the common approach of: model_base = keras.applications.VGG16(input_tensor=inputs) x = model_base.get_layer(backbone_layer).output x = keras.layers.Flatten()(x) x = keras.layers.Dense(1)(x) model = keras.models.Model

Is there any example of how to use the digital input or analog input of GPIO on google aiy voice board?

大憨熊 提交于 2021-01-29 20:28:20
问题 I can not read the input from the motion sensor (HC-SR501) which connects to PIN_A of the expansion pins on the voice bonnet of my aiy voice kit. Below are the code and the error message, please shed some light. Code: from gpiozero import MotionSensor from aiy.pins import (PIN_A, PIN_B, PIN_C, PIN_D) pir = MotionSensor(PIN_A) pir.wait_for_motion() print("Motion detected!") Error message: Traceback (most recent call last): File "/usr/lib/python3/dist-packages/gpiozero/input_devices.py", line

Unknown Syntax Error in google aiy voice kit code [duplicate]

帅比萌擦擦* 提交于 2019-12-14 03:29:48
问题 This question already has answers here : I'm getting an IndentationError. How do I fix it? (4 answers) Closed 2 years ago . When running the following code there is a syntax error. I have researched and the syntax error happens for no reason that I know. The syntax error is: File "src/cloudspeech_demo.py", line 49 elif 'repeat after me' in text: TabError: inconsistent use of tabs and spaces in indentation ^ Here is my code: #!/usr/bin/env python3 # Copyright 2017 Google Inc. # # Licensed