Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore #2835

Draft
wants to merge 19 commits into
base: master
Choose a base branch
from
Draft

Ignore #2835

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,6 @@ pip-delete-this-directory.txt
.venv
venv/
ENV/

# Cees
samples/strawberry/output/
13 changes: 7 additions & 6 deletions mrcnn/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -2170,7 +2170,7 @@ def compile(self, learning_rate, momentum):
if layer.output in self.keras_model.losses:
continue
loss = (
tf.reduce_mean(layer.output, keepdims=True)
tf.reduce_mean(layer.output, keep_dims=True)
* self.config.LOSS_WEIGHTS.get(name, 1.))
self.keras_model.add_loss(loss)

Expand All @@ -2194,7 +2194,7 @@ def compile(self, learning_rate, momentum):
layer = self.keras_model.get_layer(name)
self.keras_model.metrics_names.append(name)
loss = (
tf.reduce_mean(layer.output, keepdims=True)
tf.reduce_mean(layer.output, keep_dims=True)
* self.config.LOSS_WEIGHTS.get(name, 1.))
self.keras_model.metrics_tensors.append(loss)

Expand Down Expand Up @@ -2268,8 +2268,9 @@ def set_log_dir(self, model_path=None):
self.config.NAME.lower(), now))

# Path to save after each epoch. Include placeholders that get filled by Keras.
self.checkpoint_path = os.path.join(self.log_dir, "mask_rcnn_{}_*epoch*.h5".format(
self.config.NAME.lower()))
path_name_model = "mask_rcnn_{}_*epoch*.h5".format(
self.config.NAME.lower())
self.checkpoint_path = os.path.join(self.log_dir, path_name_model)
self.checkpoint_path = self.checkpoint_path.replace(
"*epoch*", "{epoch:04d}")

Expand Down Expand Up @@ -2370,8 +2371,8 @@ def train(self, train_dataset, val_dataset, learning_rate, epochs, layers,
validation_data=val_generator,
validation_steps=self.config.VALIDATION_STEPS,
max_queue_size=100,
workers=workers,
use_multiprocessing=True,
workers=1,
use_multiprocessing=False,
)
self.epoch = max(self.epoch, epochs)

Expand Down
9 changes: 7 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,14 @@ scipy
Pillow
cython
matplotlib
scikit-image
# scikit-image
# 3.6: use ==0.16.2
# 3.7: use ==0.19
scikit-image==0.16.2
tensorflow>=1.3.0
keras>=2.0.8
# cluster: use ==2.1.0
# computer: use >=2.0.8
keras==2.1.0
opencv-python
h5py
imgaug
Expand Down
1 change: 1 addition & 0 deletions samples/strawberry/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Strawberry