Closed Kingeng closed 6 years ago
How can i insert 'inputs:{'
at the begging of data
?
I think this can solve the problem but i can't do it
Hi @Kingeng ,
You might want to write a wrapper around yahoo/open_nsfw instead because unfortunately this conversion often returns different results.
Maybe have a look at my fork here if you want to still give it a try: https://github.com/delta9/tensorflow-open_nsfw
Run tools/export_serving_model.py to export the model which accepts raw bytes and try a client like this:
https://github.com/sebastian-schlecht/tensorflow-serving-python
I hope this helps!
@delta9
Thanks for reply can you tell me how fast is the cafe version ? is it like tensorflow serve or can i use it in production ?
i want to close all sites that maybe have NSFW content at work for all IPs.
i try your nodejs code but i dont know about it & after get some error i prefer to work on python
The error show details 'input tensor alias not found in signature: input'. You may should check the 'signature' in the code that save model. Try to modify prediction_signature
prediction_signature = ( tf.saved_model.signature_def_utils.build_signature_def( inputs={'images': predict_inputs_tensor_info, 'other_parameter': xxx}, outputs={ 'classes': classes_output_tensor_info, 'scores': scores_output_tensor_info }, method_name=tf.saved_model.signature_constants.PREDICT_METHOD_NAME ))
. Then, when you request, try request.inputs['images'].CopyFrom(data) request.inputs['other_parameter'].CopyFrom(data_other_parameter)
Hey @Kingeng, @xf4fresh
I also suspect that you might have to change the input name in your code.
If you take a look at the export script you can see that it uses PREDICT_INPUTS
as the input key. PREDICT_INPUTS
is an alias for inputs
as you can see in signature_constants.py#L49.
I'm not familiar with the API you are using, but you could try changing req=request.inputs['input'].CopyFrom(data)
to req=request.inputs['inputs'].CopyFrom(data)
Let me know if it helps.
@mdietrichstein @xf4fresh
Thanks for your reply i checked that before but it's not worked. because of problems and what i read about this model
decide to make a new classifier for NSFW and recently i finetuned inception v4 (https://github.com/tensorflow/models/tree/master/research/slim) and after this i want to try classify NSFW with nasnet-a_large
hope to get better result without any problem
Again, Thanks all of you for reply .
decide to make a new classifier for NSFW
Awesome. I wish you good luck and hope that you release your classifier on github :)
Hi @mdietrichstein @delta9
and thank you for this repository. could you please do me a favor & tell how can i write a client for this model using python i use tensorflow web and inception tutorial every thing is ok when i serve other model but for this one i don't know what should i do
can you tell me how should i change this inception code :
and i get this error :