Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into allanzelener/initia…
Browse files Browse the repository at this point in the history
…l_loss_implementation
  • Loading branch information
allanzelener committed Apr 18, 2017
2 parents 59c7515 + bd91ed9 commit e438bfa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
10 changes: 2 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@ pip install numpy
pip install tensorflow-gpu # CPU-only: conda install -c conda-forge tensorflow
pip install keras # Possibly older release: conda install keras
```
Until [Keras PR 5350](https://github.com/fchollet/keras/pull/5350) is merged:
```
pip install git+https://github.com/allanzelener/keras.git@func_defaults_to_tuple
```

## Quick Start

Expand Down Expand Up @@ -71,13 +67,11 @@ YAD2K assumes the Keras backend is Tensorflow. In particular for YOLO_v2 models

## Known Issues and TODOs

- Error deserializing Lambda wrapping space_to_depth. Apply [this PR to Keras](https://github.com/fchollet/keras/pull/5350).
- `pip install git+https://github.com/allanzelener/keras.git@func_defaults_to_tuple`
- Add YOLO_v2 loss function.
- Add YOLO_v2 loss function. (In-progress implementation on branch allanzelener/initial_loss_implementation).
- Script to train YOLO_v2 reference model.
- Support for additional Darknet layer types.
- Tuck away the Tensorflow dependencies with Keras wrappers where possible.
- YOLO_v2 model does not support fully convolutional mode.
- YOLO_v2 model does not support fully convolutional mode. Current implementation assumes 1:1 aspect ratio images.

## Darknets of Yore

Expand Down
9 changes: 3 additions & 6 deletions yad2k.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from keras.layers.normalization import BatchNormalization
from keras.models import Model
from keras.regularizers import l2
from keras.utils.visualize_util import plot
from keras.utils.vis_utils import plot_model as plot

from yad2k.models.keras_yolo import (space_to_depth_x2,
space_to_depth_x2_output_shape)
Expand Down Expand Up @@ -238,7 +238,8 @@ def _main(args):
prev_layer = all_layers[-1]

elif section.startswith('region'):
anchors = cfg_parser[section]['anchors']
with open('{}_anchors.txt'.format(output_root), 'w') as f:
print(cfg_parser[section]['anchors'], file=f)

elif (section.startswith('net') or section.startswith('cost') or
section.startswith('softmax')):
Expand All @@ -261,10 +262,6 @@ def _main(args):
if remaining_weights > 0:
print('Warning: {} unused weights'.format(len(remaining_weights)))

if 'region' in cfg_parser.sections():
with open('{}_anchors.txt'.format(output_root), 'w') as f:
print(anchors, file=f)

if args.plot_model:
plot(model, to_file='{}.png'.format(output_root), show_shapes=True)
print('Saved model plot to {}.png'.format(output_root))
Expand Down

0 comments on commit e438bfa

Please sign in to comment.