Commit aaf62f2d authored by Yuxin Wu's avatar Yuxin Wu

KeyboardInterrupt is not an Exception

parent 13e7f38f
...@@ -6,7 +6,7 @@ PLEASE always include the following: ...@@ -6,7 +6,7 @@ PLEASE always include the following:
1. What you did. (command you run if using examples; post or describe your code if not) 1. What you did. (command you run if using examples; post or describe your code if not)
2. What you observed, e.g. logs. 2. What you observed, e.g. logs.
3. What you expected, if not obvious. 3. What you expected, if not obvious.
4. Your environment (TF version, cudnn version, GPU model), if it matters. 4. Your environment (TF version, cudnn version, number & type of GPUs), if it matters.
Feature Requests: Feature Requests:
1. Improve an existing feature. 1. Improve an existing feature.
......
...@@ -47,7 +47,7 @@ To evaluate the performance (pretrained models can be downloaded in [model zoo]( ...@@ -47,7 +47,7 @@ To evaluate the performance (pretrained models can be downloaded in [model zoo](
Mean Average Precision @IoU=0.50:0.95: Mean Average Precision @IoU=0.50:0.95:
+ trainval35k/minival, FASTRCNN_BATCH=256: 34.2. Takes 49h on 8 TitanX. + trainval35k/minival, FASTRCNN_BATCH=256: 34.2. Takes 49h on 8 TitanX.
+ trainval35k/minival, FASTRCNN_BATCH=64: 32.7. Takes 31h on 8 TitanX. + trainval35k/minival, FASTRCNN_BATCH=64: 33.0. Takes 22h on 8 P100.
The hyperparameters are not carefully tuned. You can probably get better performance by e.g. training longer. The hyperparameters are not carefully tuned. You can probably get better performance by e.g. training longer.
......
...@@ -24,6 +24,8 @@ Usage: ...@@ -24,6 +24,8 @@ Usage:
python -m tensorpack.utils.loadcaffe \ python -m tensorpack.utils.loadcaffe \
PATH/TO/VGG/{VGG_ILSVRC_16_layers_deploy.prototxt,VGG_ILSVRC_16_layers.caffemodel} vgg16.npy PATH/TO/VGG/{VGG_ILSVRC_16_layers_deploy.prototxt,VGG_ILSVRC_16_layers.caffemodel} vgg16.npy
Or download a converted caffe model from http://models.tensorpack.com/caffe/
./load-vgg16.py --load vgg16.npy --input cat.png ./load-vgg16.py --load vgg16.npy --input cat.png
""" """
......
...@@ -134,8 +134,6 @@ class BatchData(ProxyDataFlow): ...@@ -134,8 +134,6 @@ class BatchData(ProxyDataFlow):
try: try:
result.append( result.append(
np.asarray([x[k] for x in data_holder], dtype=tp)) np.asarray([x[k] for x in data_holder], dtype=tp))
except KeyboardInterrupt:
raise
except Exception as e: # noqa except Exception as e: # noqa
logger.exception("Cannot batch data. Perhaps they are of inconsistent shape?") logger.exception("Cannot batch data. Perhaps they are of inconsistent shape?")
if isinstance(dt, np.ndarray): if isinstance(dt, np.ndarray):
......
...@@ -245,8 +245,6 @@ class ILSVRC12(ILSVRC12Files): ...@@ -245,8 +245,6 @@ class ILSVRC12(ILSVRC12Files):
try: try:
ret.append(parse_bbox(fname)) ret.append(parse_bbox(fname))
cnt += 1 cnt += 1
except KeyboardInterrupt:
raise
except Exception: except Exception:
ret.append(None) ret.append(None)
logger.info("{}/{} images have bounding box.".format(cnt, len(imglist))) logger.info("{}/{} images have bounding box.".format(cnt, len(imglist)))
......
...@@ -28,8 +28,6 @@ class ExceptionHandler: ...@@ -28,8 +28,6 @@ class ExceptionHandler:
def catch(self): def catch(self):
try: try:
yield yield
except KeyboardInterrupt:
raise
except Exception: except Exception:
self._nr_error += 1 self._nr_error += 1
if not self.catch_exceptions: if not self.catch_exceptions:
......
...@@ -225,7 +225,6 @@ class Trainer(object): ...@@ -225,7 +225,6 @@ class Trainer(object):
logger.info("Training was stopped.") logger.info("Training was stopped.")
except KeyboardInterrupt: except KeyboardInterrupt:
logger.info("Detected Ctrl-C and exiting main loop.") logger.info("Detected Ctrl-C and exiting main loop.")
except Exception:
raise raise
finally: finally:
self._callbacks.after_train() self._callbacks.after_train()
......
...@@ -273,7 +273,6 @@ class Trainer(object): ...@@ -273,7 +273,6 @@ class Trainer(object):
logger.info("Training was stopped.") logger.info("Training was stopped.")
except KeyboardInterrupt: except KeyboardInterrupt:
logger.info("Detected Ctrl-C and exiting main loop.") logger.info("Detected Ctrl-C and exiting main loop.")
except Exception:
raise raise
finally: finally:
self._callbacks.after_train() self._callbacks.after_train()
......
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