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

Bug/fix parallel mode #2855

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions mrcnn/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -2274,7 +2274,7 @@ def set_log_dir(self, model_path=None):
"*epoch*", "{epoch:04d}")

def train(self, train_dataset, val_dataset, learning_rate, epochs, layers,
augmentation=None, custom_callbacks=None, no_augmentation_sources=None):
workers=multiprocessing.cpu_count(), use_multiprocessing=True, augmentation=None, custom_callbacks=None, no_augmentation_sources=None):
"""Train the model.
train_dataset, val_dataset: Training and validation Dataset objects.
learning_rate: The learning rate to train with
Expand Down Expand Up @@ -2359,7 +2359,7 @@ def train(self, train_dataset, val_dataset, learning_rate, epochs, layers,
if os.name is 'nt':
workers = 0
else:
workers = multiprocessing.cpu_count()
workers = workers

self.keras_model.fit_generator(
train_generator,
Expand All @@ -2371,7 +2371,7 @@ def train(self, train_dataset, val_dataset, learning_rate, epochs, layers,
validation_steps=self.config.VALIDATION_STEPS,
max_queue_size=100,
workers=workers,
use_multiprocessing=True,
use_multiprocessing=use_multiprocessing,
)
self.epoch = max(self.epoch, epochs)

Expand Down
1 change: 1 addition & 0 deletions mrcnn/parallel_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ def __init__(self, keras_model, gpu_count):
keras_model: The Keras model to parallelize
gpu_count: Number of GPUs. Must be > 1
"""
super(ParallelModel, self).__init__()
self.inner_model = keras_model
self.gpu_count = gpu_count
merged_outputs = self.make_parallel()
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def _parse_requirements(file_path):

setup(
name='mask-rcnn',
version='2.1',
version='2.1.2',
url='https://github.com/matterport/Mask_RCNN',
author='Matterport',
author_email='waleed.abdulla@gmail.com',
Expand Down