{"action":"created","issue":{"url":"https://api.github.com/repos/fchollet/keras/issues/368","labels_url":"https://api.github.com/repos/fchollet/keras/issues/368/labels{/name}","comments_url":"https://api.github.com/repos/fchollet/keras/issues/368/comments","events_url":"https://api.github.com/repos/fchollet/keras/issues/368/events","html_url":"https://github.com/fchollet/keras/pull/368","id":93905967,"number":368,"title":"Caffe support by pranv","user":{"login":"fchollet","id":710255,"avatar_url":"https://avatars.githubusercontent.com/u/710255?v=3","gravatar_id":"","url":"https://api.github.com/users/fchollet","html_url":"https://github.com/fchollet","followers_url":"https://api.github.com/users/fchollet/followers","following_url":"https://api.github.com/users/fchollet/following{/other_user}","gists_url":"https://api.github.com/users/fchollet/gists{/gist_id}","starred_url":"https://api.github.com/users/fchollet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fchollet/subscriptions","organizations_url":"https://api.github.com/users/fchollet/orgs","repos_url":"https://api.github.com/users/fchollet/repos","events_url":"https://api.github.com/users/fchollet/events{/privacy}","received_events_url":"https://api.github.com/users/fchollet/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":15,"created_at":"2015-07-08T22:38:10Z","updated_at":"2015-07-15T07:58:47Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/fchollet/keras/pulls/368","html_url":"https://github.com/fchollet/keras/pull/368","diff_url":"https://github.com/fchollet/keras/pull/368.diff","patch_url":"https://github.com/fchollet/keras/pull/368.patch"},"body":"Creating a PR for easier reviewing"},"comment":{"url":"https://api.github.com/repos/fchollet/keras/issues/comments/121522273","html_url":"https://github.com/fchollet/keras/pull/368#issuecomment-121522273","issue_url":"https://api.github.com/repos/fchollet/keras/issues/368","id":121522273,"user":{"login":"fchollet","id":710255,"avatar_url":"https://avatars.githubusercontent.com/u/710255?v=3","gravatar_id":"","url":"https://api.github.com/users/fchollet","html_url":"https://github.com/fchollet","followers_url":"https://api.github.com/users/fchollet/followers","following_url":"https://api.github.com/users/fchollet/following{/other_user}","gists_url":"https://api.github.com/users/fchollet/gists{/gist_id}","starred_url":"https://api.github.com/users/fchollet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fchollet/subscriptions","organizations_url":"https://api.github.com/users/fchollet/orgs","repos_url":"https://api.github.com/users/fchollet/repos","events_url":"https://api.github.com/users/fchollet/events{/privacy}","received_events_url":"https://api.github.com/users/fchollet/received_events","type":"User","site_admin":false},"created_at":"2015-07-15T07:58:47Z","updated_at":"2015-07-15T07:58:47Z","body":"The protobuf issue is fixed in a clean way by adding the following to setup.py:\r\n\r\n```python\r\nimport os\r\nfrom six.moves.urllib.request import urlretrieve\r\n\r\n# First, compile Caffe protobuf Python file\r\ndatadir = os.path.expanduser(os.path.join('~', '.keras', 'data'))\r\nif not os.path.exists(datadir):\r\n    os.makedirs(datadir)\r\n\r\ncaffe_source = os.path.join(datadir, 'caffe.proto')\r\ncaffe_destination = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'keras', 'caffe')\r\nurlretrieve('https://raw.githubusercontent.com/BVLC/caffe/master/src/caffe/proto/caffe.proto', caffe_source)\r\nos.system('protoc --proto_path=\"' + datadir + '\" --python_out=\"' + caffe_destination + '\" \"' + caffe_source + '\"')\r\n```\r\n\r\nThis should be Windows compatible as well.\r\n\r\nOnly potential issue is that this requires Protobuf to be installed before running setup.py. Or else Caffe import won't work (Keras can still be installed though)."}}