Hello everybody,
I get an error when I want to run demo.py.
C:\Users\Tom\Anaconda3\lib\site-packages\mask_rcnn-2.1-py3.7.egg\mrcnn\visualize.py:167: UserWarning: Matplotlib is currently using agg, which is a non-GUI backend, so cannot show the figure.
Does anybody know how to solve that issue?
(base) C:\Users\Tom\Downloads\Mask_RCNN-master\samples>python demo.py
Using TensorFlow backend.
Configurations:
BACKBONE resnet101
BACKBONE_STRIDES [4, 8, 16, 32, 64]
BATCH_SIZE 1
BBOX_STD_DEV [0.1 0.1 0.2 0.2]
COMPUTE_BACKBONE_SHAPE None
DETECTION_MAX_INSTANCES 100
DETECTION_MIN_CONFIDENCE 0.7
DETECTION_NMS_THRESHOLD 0.3
FPN_CLASSIF_FC_LAYERS_SIZE 1024
GPU_COUNT 1
GRADIENT_CLIP_NORM 5.0
IMAGES_PER_GPU 1
IMAGE_CHANNEL_COUNT 3
IMAGE_MAX_DIM 1024
IMAGE_META_SIZE 93
IMAGE_MIN_DIM 800
IMAGE_MIN_SCALE 0
IMAGE_RESIZE_MODE square
IMAGE_SHAPE [1024 1024 3]
LEARNING_MOMENTUM 0.9
LEARNING_RATE 0.001
LOSS_WEIGHTS {'rpn_class_loss': 1.0, 'rpn_bbox_loss': 1.0, 'mrcnn_class_loss': 1.0, 'mrcnn_bbox_loss': 1.0, 'mrcnn_mask_loss': 1.0}
MASK_POOL_SIZE 14
MASK_SHAPE [28, 28]
MAX_GT_INSTANCES 100
MEAN_PIXEL [123.7 116.8 103.9]
MINI_MASK_SHAPE (56, 56)
NAME coco
NUM_CLASSES 81
POOL_SIZE 7
POST_NMS_ROIS_INFERENCE 1000
POST_NMS_ROIS_TRAINING 2000
PRE_NMS_LIMIT 6000
ROI_POSITIVE_RATIO 0.33
RPN_ANCHOR_RATIOS [0.5, 1, 2]
RPN_ANCHOR_SCALES (32, 64, 128, 256, 512)
RPN_ANCHOR_STRIDE 1
RPN_BBOX_STD_DEV [0.1 0.1 0.2 0.2]
RPN_NMS_THRESHOLD 0.7
RPN_TRAIN_ANCHORS_PER_IMAGE 256
STEPS_PER_EPOCH 1000
TOP_DOWN_PYRAMID_SIZE 256
TRAIN_BN False
TRAIN_ROIS_PER_IMAGE 200
USE_MINI_MASK True
USE_RPN_ROIS True
VALIDATION_STEPS 50
WEIGHT_DECAY 0.0001
WARNING: Logging before flag parsing goes to stderr.
W0812 20:14:34.686454 16204 deprecation_wrapper.py:119] From C:\Users\Tom\Anaconda3\lib\site-packages\kerasbackend\tensorflow_backend.py:517: The name tf.placeholder is deprecated. Please use tf.compat.v1.placeholder instead.
W0812 20:14:34.703469 16204 deprecation_wrapper.py:119] From C:\Users\Tom\Anaconda3\lib\site-packages\kerasbackend\tensorflow_backend.py:74: The name tf.get_default_graph is deprecated. Please use tf.compat.v1.get_default_graph instead.
W0812 20:14:34.705471 16204 deprecation_wrapper.py:119] From C:\Users\Tom\Anaconda3\lib\site-packages\kerasbackend\tensorflow_backend.py:4138: The name tf.random_uniform is deprecated. Please use tf.random.uniform instead.
W0812 20:14:34.721485 16204 deprecation_wrapper.py:119] From C:\Users\Tom\Anaconda3\lib\site-packages\kerasbackend\tensorflow_backend.py:1919: The name tf.nn.fused_batch_norm is deprecated. Please use tf.compat.v1.nn.fused_batch_norm instead.
W0812 20:14:34.723488 16204 deprecation_wrapper.py:119] From C:\Users\Tom\Anaconda3\lib\site-packages\kerasbackend\tensorflow_backend.py:3976: The name tf.nn.max_pool is deprecated. Please use tf.nn.max_pool2d instead.
W0812 20:14:36.566161 16204 deprecation_wrapper.py:119] From C:\Users\Tom\Anaconda3\lib\site-packages\kerasbackend\tensorflow_backend.py:2018: The name tf.image.resize_nearest_neighbor is deprecated. Please use tf.compat.v1.image.resize_nearest_neighbor instead.
W0812 20:14:36.868444 16204 deprecation_wrapper.py:119] From C:\Users\Tom\Anaconda3\lib\site-packages\mask_rcnn-2.1-py3.7.egg\mrcnn\model.py:341: The name tf.log is deprecated. Please use tf.math.log instead.
W0812 20:14:36.874443 16204 deprecation.py:323] From C:\Users\Tom\Anaconda3\lib\site-packages\mask_rcnn-2.1-py3.7.egg\mrcnn\model.py:399: add_dispatch_support.
Instructions for updating:
Use tf.where in 2.0, which has the same broadcast rule as np.where
W0812 20:14:36.878452 16204 deprecation.py:506] From C:\Users\Tom\Anaconda3\lib\site-packages\mask_rcnn-2.1-py3.7.egg\mrcnn\model.py:423: calling crop_and_resize_v1 (from tensorflow.python.ops.image_ops_impl) with box_ind is deprecated and will be removed in a future version.
Instructions for updating:
box_ind is deprecated, use box_indices instead
W0812 20:14:37.043595 16204 deprecation_wrapper.py:119] From C:\Users\Tom\Anaconda3\lib\site-packages\mask_rcnn-2.1-py3.7.egg\mrcnn\model.py:720: The name tf.sets.set_intersection is deprecated. Please use tf.sets.intersection instead.
W0812 20:14:37.046597 16204 deprecation_wrapper.py:119] From C:\Users\Tom\Anaconda3\lib\site-packages\mask_rcnn-2.1-py3.7.egg\mrcnn\model.py:722: The name tf.sparse_tensor_to_dense is deprecated. Please use tf.sparse.to_dense instead.
W0812 20:14:37.108654 16204 deprecation.py:323] From C:\Users\Tom\Anaconda3\lib\site-packages\mask_rcnn-2.1-py3.7.egg\mrcnn\model.py:772: to_float (from tensorflow.python.ops.math_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Use tf.cast instead.
2019-08-12 20:14:38.324432: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX AVX2
2019-08-12 20:14:38.333807: I tensorflow/stream_executor/platform/default/dso_loader.cc:42] Successfully opened dynamic library nvcuda.dll
2019-08-12 20:14:38.459684: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1640] Found device 0 with properties:
name: GeForce GTX 1060 6GB major: 6 minor: 1 memoryClockRate(GHz): 1.7845
pciBusID: 0000:41:00.0
2019-08-12 20:14:38.466616: I tensorflow/stream_executor/platform/default/dlopen_checker_stub.cc:25] GPU libraries are statically linked, skip dlopen check.
2019-08-12 20:14:38.473152: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1763] Adding visible gpu devices: 0
2019-08-12 20:14:39.144248: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1181] Device interconnect StreamExecutor with strength 1 edge matrix:
2019-08-12 20:14:39.148883: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1187] 0
2019-08-12 20:14:39.151701: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1200] 0: N
2019-08-12 20:14:39.156002: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1326] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 4712 MB memory) -> physical GPU (device: 0, name: GeForce GTX 1060 6GB, pci bus id: 0000:41:00.0, compute capability: 6.1)
Processing 1 images
image shape: (511, 640, 3) min: 0.00000 max: 255.00000 uint8
molded_images shape: (1, 1024, 1024, 3) min: -123.70000 max: 150.10000 float64
image_metas shape: (1, 93) min: 0.00000 max: 1024.00000 float64
anchors shape: (1, 261888, 4) min: -0.35390 max: 1.29134 float32
C:\Users\Tom\Anaconda3\lib\site-packages\mask_rcnn-2.1-py3.7.egg\mrcnn\visualize.py:167: UserWarning: Matplotlib is currently using agg, which is a non-GUI backend, so cannot show the figure.
I have the same problem
Did you solve the problem?
I meet the same problem, and choose to save the figure to the local disk.
Same problem while running it on pycharm
Has anyone found a solution to this?
Install a matplotlib previous version has resolved the issue for me :
pip install matplotlib==2.2.2
These worked for me:
import tkinter
import matplotlib
matplotlib.use('TkAgg')
Most helpful comment
Install a matplotlib previous version has resolved the issue for me :
pip install matplotlib==2.2.2