{"action":"created","issue":{"url":"https://api.github.com/repos/keras-team/keras/issues/8487","repository_url":"https://api.github.com/repos/keras-team/keras","labels_url":"https://api.github.com/repos/keras-team/keras/issues/8487/labels{/name}","comments_url":"https://api.github.com/repos/keras-team/keras/issues/8487/comments","events_url":"https://api.github.com/repos/keras-team/keras/issues/8487/events","html_url":"https://github.com/keras-team/keras/issues/8487","id":273992360,"node_id":"MDU6SXNzdWUyNzM5OTIzNjA=","number":8487,"title":"Imagenet preprocess code: why not subtracting \"mean pixels\" in tf mode?","user":{"login":"olalonde","id":416585,"node_id":"MDQ6VXNlcjQxNjU4NQ==","avatar_url":"https://avatars3.githubusercontent.com/u/416585?v=4","gravatar_id":"","url":"https://api.github.com/users/olalonde","html_url":"https://github.com/olalonde","followers_url":"https://api.github.com/users/olalonde/followers","following_url":"https://api.github.com/users/olalonde/following{/other_user}","gists_url":"https://api.github.com/users/olalonde/gists{/gist_id}","starred_url":"https://api.github.com/users/olalonde/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/olalonde/subscriptions","organizations_url":"https://api.github.com/users/olalonde/orgs","repos_url":"https://api.github.com/users/olalonde/repos","events_url":"https://api.github.com/users/olalonde/events{/privacy}","received_events_url":"https://api.github.com/users/olalonde/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-11-15T00:28:24Z","updated_at":"2018-10-07T13:41:17Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"https://github.com/fchollet/keras/blob/2.1.1/keras/applications/imagenet_utils.py#L36\r\n\r\nI'm a bit confused by the `preprocess_input` in `imagenet_utils.py`. It seems like in `tf` mode it just uses a mean of `255/2` instead of the empirical per-channel means that is used in Caffe mode: ` 103.939, 116.779, 123.68`. It also scales the pixel values to be between `[-1, 1]`, whereas the pixel values are not scaled at all in Caffe mode.  Is there a reason for this that I am missing?"},"comment":{"url":"https://api.github.com/repos/keras-team/keras/issues/comments/427654515","html_url":"https://github.com/keras-team/keras/issues/8487#issuecomment-427654515","issue_url":"https://api.github.com/repos/keras-team/keras/issues/8487","id":427654515,"node_id":"MDEyOklzc3VlQ29tbWVudDQyNzY1NDUxNQ==","user":{"login":"ztf-ucas","id":18568981,"node_id":"MDQ6VXNlcjE4NTY4OTgx","avatar_url":"https://avatars3.githubusercontent.com/u/18568981?v=4","gravatar_id":"","url":"https://api.github.com/users/ztf-ucas","html_url":"https://github.com/ztf-ucas","followers_url":"https://api.github.com/users/ztf-ucas/followers","following_url":"https://api.github.com/users/ztf-ucas/following{/other_user}","gists_url":"https://api.github.com/users/ztf-ucas/gists{/gist_id}","starred_url":"https://api.github.com/users/ztf-ucas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ztf-ucas/subscriptions","organizations_url":"https://api.github.com/users/ztf-ucas/orgs","repos_url":"https://api.github.com/users/ztf-ucas/repos","events_url":"https://api.github.com/users/ztf-ucas/events{/privacy}","received_events_url":"https://api.github.com/users/ztf-ucas/received_events","type":"User","site_admin":false},"created_at":"2018-10-07T13:41:17Z","updated_at":"2018-10-07T13:41:17Z","author_association":"NONE","body":"@olalonde \r\nHi! I want to know should I scale input pixels between -1 and 1 with tf backend when\r\nI train model with imagenet weight? Or just preprocess like caffe model?\r\nI am very confused what to this？\r\nI I observed that the pretrained VGG weights are mostly decimal.Seem to the input range is (-1-1)?"}}
{"actor":{"display_login":"ztf-ucas"}}