googlecodelabs / tensorflow-for-poets-2

Apache License 2.0
507 stars 465 forks source link

Using the Inception v3 or v4 architecture #37

Open mhenrichsen opened 6 years ago

mhenrichsen commented 6 years ago

Hi,

I'm trying to classify some images that are very similar, so I need the more precise Inception architecture.

I've tried using the following command, but to no avail:

IMAGE_SIZE=224
ARCHITECTURE="inceptionv3${IMAGE_SIZE}"

Getting the following error: Couldn't understand architecture name 'inceptionv3224'

Any ideas?

clayliao commented 6 years ago

By default this script will use the high accuracy, but comparatively large and slow Inception v3 model architecture, see https://github.com/googlecodelabs/tensorflow-for-poets-2/blob/master/scripts/retrain.py#L1311-L1324

Try to setup the correct and run the sample script: $ARCHITECTURE="inception_v3"

wowliuzj commented 6 years ago

Hi, I used your script to train by inception v3. Training is fine, but when I try to classify image, I got this KeyError: "The name 'import/input' refers to an Operation not in the graph." I run tensorflow with version 1.6 and 1.4, both get the same result. Any idea to fix this?

JackBuggins commented 6 years ago

@wowliuzj, yep sorry - check issue #3 for the fix. @epreble showed an update in a commit that seemed to be the culprit; it works fine if you revert that commit

wowliuzj commented 6 years ago

@JackBuggins ,thank you so much, let me try it.

wowliuzj commented 6 years ago

@JackBuggins , great, it works! But when I put the model in my cell phone, I got this error "No OpKernel was registered to support Op 'DecodeJpeg' with these attrs. Registered devices: [CPU], Registered kernels", Do you know anything about this?

JackBuggins commented 6 years ago

@wowliuzj Unfortunately I don’t. Without any more info my hunch would be a dependency is missing or an environment variable hasn’t been configured correctly; but I’m by no means claiming to be in the know here 😂 If you add the target environment details, tf version and the model you are using in the comments others may be able to contribute with some specifics better than myself.

If it’s just a cell issu and works fine in a desktop environment you could try something along the lines of ANDROID_TYPES=ANDROID_TYPES_FULL