Commit 149ad4eb authored by Yuxin Wu's avatar Yuxin Wu

fix rgb/bgr in ResNet script

parent 02a5d258
......@@ -8,14 +8,15 @@ Models can be [downloaded here](https://goo.gl/6XjK9V).
| Model | Top 5 Error | Top 1 Error |
|:-------------------|-------------|------------:|
| ResNet 18 | 10.67% | 29.50% |
| ResNet 34 | 8.66% | 26.45% |
| ResNet 50 | 7.13% | 24.12% |
| ResNet 101 | 6.54% | 22.89% |
| ResNet18 | 10.55% | 29.73% |
| ResNet34 | 8.51% | 26.50% |
| ResNet50 | 7.24% | 23.91% |
| ResNet50-SE | 6.42% | 22.94% |
| ResNet101 | 6.26% | 22.53% |
To train, just run:
```bash
./imagenet-resnet.py --data /path/to/original/ILSVRC --gpu 0,1,2,3 -d 18
./imagenet-resnet.py --data /path/to/original/ILSVRC --gpu 0,1,2,3 -d 50
```
You should be able to see good GPU utilization (around 95%), if your data is fast enough.
See the [tutorial](http://tensorpack.readthedocs.io/en/latest/tutorial/efficient-dataflow.html) on how to speed up your data.
......
......@@ -45,9 +45,7 @@ class Model(ModelDesc):
def _build_graph(self, inputs):
image, label = inputs
# It should actually use bgr=True here, but for compatibility with
# pretrained models, we keep the wrong version.
image = image_preprocess(image, bgr=False)
image = image_preprocess(image, bgr=True)
if self.data_format == 'NCHW':
image = tf.transpose(image, [0, 3, 1, 2])
......
......@@ -25,4 +25,7 @@ os.environ['TF_ENABLE_WINOGRAD_NONFUSED'] = '1' # issue#9339
os.environ['TF_AUTOTUNE_THRESHOLD'] = '3' # use more warm-up
os.environ['TF_AVGPOOL_USE_CUDNN'] = '1' # issue#8566
import tensorflow as tf # noqa
assert int(tf.__version__.split('.')[0]) >= 1, "TF>=1.0 is required!"
__version__ = '0.3.0'
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment