Are there any people working on porting Yahoo's Open NSFW Caffe model to TF?

529 views
Skip to first unread message

Alec Matusis

unread,
Oct 19, 2016, 4:09:14 PM10/19/16
to Discuss
We tried to migrate https://github.com/yahoo/open_nsfw model to TF using https://github.com/ethereon/caffe-tensorflow .
It all worked, but we get different results from Caffe. Has anybody done this, are there people working on it?

jo...@vinted.com

unread,
Oct 22, 2016, 4:23:37 AM10/22/16
to Discuss
Hi, We tried that as well. The numbers are different, but still seem to be pretty good. I thought maybe I was doing something wrong with preprocessing. Not sure how to get the same numbers ATM.

Yaroslav Bulatov

unread,
Oct 22, 2016, 5:36:56 PM10/22/16
to jo...@vinted.com, Discuss
The standard (and time consuming) approach for debugging numerical difference is to get a simplest example where the calculation is different and compare each set of intermediate results (you can fetch intermediate results using session.run([intermediate_tensor1, ...]). There's likely to be some slight difference in what pre-processing ops do

--
You received this message because you are subscribed to the Google Groups "Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss+unsubscribe@tensorflow.org.
To post to this group, send email to dis...@tensorflow.org.
To view this discussion on the web visit https://groups.google.com/a/tensorflow.org/d/msgid/discuss/b2a2bb8c-288f-41b6-a81b-df0e3707f876%40tensorflow.org.

Dmytro Filatov

unread,
Mar 22, 2017, 9:34:01 PM3/22/17
to Discuss, jo...@vinted.com
Hi, I'm trying to replicate the same NSFW model in TF, but caffe-tensorflow returns error:

Converting data...
Saving source...


Traceback (most recent call last):
 
File "./caffe-tensorflow/convert.py", line 60, in <module>
    main
()
 
File "./caffe-tensorflow/convert.py", line 56, in main
    args
.phase)
 
File "./caffe-tensorflow/convert.py", line 37, in convert
    src_out
.write(transformer.transform_source())
 
File "/root/caffe-tensorflow/kaffe/tensorflow/transformer.py", line 282, in transform_source
    chains
= mapper.map()
 
File "/root/caffe-tensorflow/kaffe/graph.py", line 288, in map
    mapped_chains
.append(self.map_chain(chain))
 
File "/root/caffe-tensorflow/kaffe/graph.py", line 292, in map_chain
   
return [self.map_node(node) for node in chain]
 
File "/root/caffe-tensorflow/kaffe/graph.py", line 296, in map_node
    mapped_node
= map_func(node)
 
File "/root/caffe-tensorflow/kaffe/tensorflow/transformer.py", line 149, in map_batch_norm
    scale_offset
= len(node.data) == 4
TypeError: object of type 'NoneType' has no len()

Have you made any advancements on this project?
Could you please share your TF model or suggest what may be an issue here?

Thanks

command I use to run convert:
./caffe-tensorflow/convert.py open_nsfw/nsfw_model/deploy.prototxt --code-output-path=nsfw.py

marc.diet...@gmail.com

unread,
Jun 1, 2017, 5:23:57 AM6/1/17
to Discuss, jo...@vinted.com
Hi everyone,

I've managed to convert the caffe model to tensorflow. You can check out the code on Github: tensorflow-open_nsfw.

There are still some differences to the original model for some inputs. Might have to do with preprocessing, although I've tried to keep my image loading code as close as possible to the original one.

One reason might be that caffe is using different versions of skimage and pillow for decoding and manipulating the image data?

Still have to investigate that one and any help would be appreciated :)

marc.diet...@gmail.com

unread,
Jun 1, 2017, 5:24:52 AM6/1/17
to Discuss, jo...@vinted.com, marc.diet...@gmail.com
Reply all
Reply to author
Forward
0 new messages