Giter VIP home page Giter VIP logo

keras-fasterrcnn's Introduction

Keras-FasterRCNN

Keras implementation of Faster R-CNN: Towards Real-Time Object Detection with Region Proposal Networks.
cloned from https://github.com/yhenon/keras-frcnn/

UPDATE:

  • supporting inception_resnet_v2
    • for use inception_resnet_v2 in keras.application as feature extractor, create new inception_resnet_v2 model file using transfer/export_imagenet.py
    • if use original inception_resnet_v2 model as feature extractor, you can't load weight parameter on faster-rcnn

USAGE:

  • Both theano and tensorflow backends are supported. However compile times are very high in theano, and tensorflow is highly recommended.

  • train_frcnn.py can be used to train a model. To train on Pascal VOC data, simply do: python train_frcnn.py -p /path/to/pascalvoc/.

  • the Pascal VOC data set (images and annotations for bounding boxes around the classified objects) can be obtained from: http://host.robots.ox.ac.uk/pascal/VOC/voc2012/VOCtrainval_11-May-2012.tar

  • simple_parser.py provides an alternative way to input data, using a text file. Simply provide a text file, with each line containing:

    filepath,x1,y1,x2,y2,class_name

    For example:

    /data/imgs/img_001.jpg,837,346,981,456,cow

    /data/imgs/img_002.jpg,215,312,279,391,cat

    The classes will be inferred from the file. To use the simple parser instead of the default pascal voc style parser, use the command line option -o simple. For example python train_frcnn.py -o simple -p my_data.txt.

  • Running train_frcnn.py will write weights to disk to an hdf5 file, as well as all the setting of the training run to a pickle file. These settings can then be loaded by test_frcnn.py for any testing.

  • test_frcnn.py can be used to perform inference, given pretrained weights and a config file. Specify a path to the folder containing images: python test_frcnn.py -p /path/to/test_data/

  • Data augmentation can be applied by specifying --hf for horizontal flips, --vf for vertical flips and --rot for 90 degree rotations

NOTES:

  • config.py contains all settings for the train or test run. The default settings match those in the original Faster-RCNN paper. The anchor box sizes are [128, 256, 512] and the ratios are [1:1, 1:2, 2:1].
  • The theano backend by default uses a 7x7 pooling region, instead of 14x14 as in the frcnn paper. This cuts down compiling time slightly.
  • The tensorflow backend performs a resize on the pooling region, instead of max pooling. This is much more efficient and has little impact on results.

Example output:

ex1 ex2 ex3 ex4

ISSUES:

  • If you get this error: ValueError: There is a negative shape in the graph!
    than update keras to the newest version

  • Make sure to use python2, not python3. If you get this error: TypeError: unorderable types: dict() < dict() you are using python3

  • If you run out of memory, try reducing the number of ROIs that are processed simultaneously. Try passing a lower -n to train_frcnn.py. Alternatively, try reducing the image size from the default value of 600 (this setting is found in config.py.

Reference

[1] Faster R-CNN: Towards Real-Time Object Detection with Region Proposal Networks, 2015
[2] Inception-v4, Inception-ResNet and the Impact of Residual Connections on Learning, 2016
[3] https://github.com/yhenon/keras-frcnn/

keras-fasterrcnn's People

Contributors

collinarnett avatar you359 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

keras-fasterrcnn's Issues

tensorflow.python.framework.errors_impl.InvalidArgumentError: slice index 31 of dimension 1 out of bounds.

My environment is
Ubuntu 18.04
Tensorflow 1.14.0
Keras 2.2.4

I'm using simple parser with some edit from here #6

like this

        if C.num_rois > 1:
            if len(pos_samples) < C.num_rois // 2:
                selected_pos_samples = pos_samples.tolist()
            else:
                if len(pos_samples) > 0:
                    selected_pos_samples = np.random.choice(pos_samples, C.num_rois // 2, replace=False).tolist()
                else:
                    selected_pos_samples = []
            try:
                if len(neg_samples) > 0:
                    selected_neg_samples = np.random.choice(neg_samples, C.num_rois - len(selected_pos_samples),
                                                            replace=False).tolist()
                else:
                    selected_neg_samples = []
            except:
                if len(neg_samples) > 0:
                    selected_neg_samples = np.random.choice(neg_samples, C.num_rois - len(selected_pos_samples),
                                                            replace=True).tolist()
                else:
                    selected_neg_samples = []

            sel_samples = selected_pos_samples + selected_neg_samples
            if len(sel_samples) == 0:
                continue

and I delete all val and test set, use all_imgs as trian set right away.

The problem is, at a certain point in the first epoch(say 300th iteration), this error comes.

2019-10-19 16:43:33.168527: W tensorflow/core/framework/op_kernel.cc:1273] OP_REQUIRES failed at strided_slice_op.cc:106 : Invalid argument: slice index 21 of dimension 1 out of bounds.
2019-10-19 16:43:33.168539: W tensorflow/core/framework/op_kernel.cc:1273] OP_REQUIRES failed at strided_slice_op.cc:106 : Invalid argument: slice index 21 of dimension 1 out of bounds.
2019-10-19 16:43:33.168550: W tensorflow/core/framework/op_kernel.cc:1273] OP_REQUIRES failed at strided_slice_op.cc:106 : Invalid argument: slice index 22 of dimension 1 out of bounds.
Traceback (most recent call last):
  File "rcnn/train_frcnn.py", line 292, in <module>
    loss_class = model_classifier.train_on_batch([X, X2[:, sel_samples, :]], [Y1[:, sel_samples, :], Y2[:, sel_samples, :]])
  File "/home/palm/miniconda3/envs/main36/lib/python3.6/site-packages/keras/engine/training.py", line 1217, in train_on_batch
    outputs = self.train_function(ins)
  File "/home/palm/miniconda3/envs/main36/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py", line 2715, in __call__
    return self._call(inputs)
  File "/home/palm/miniconda3/envs/main36/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py", line 2675, in _call
    fetched = self._callable_fn(*array_vals)
  File "/home/palm/miniconda3/envs/main36/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1439, in __call__
    run_metadata_ptr)
  File "/home/palm/miniconda3/envs/main36/lib/python3.6/site-packages/tensorflow/python/framework/errors_impl.py", line 528, in __exit__
    c_api.TF_GetCode(self.status.status))
tensorflow.python.framework.errors_impl.InvalidArgumentError: slice index 31 of dimension 1 out of bounds.
	 [[{{node roi_pooling_conv_1/strided_slice_157}} = StridedSlice[Index=DT_INT32, T=DT_FLOAT, begin_mask=0, ellipsis_mask=0, end_mask=0, new_axis_mask=0, shrink_axis_mask=7, _device="/job:localhost/replica:0/task:0/device:GPU:0"](_arg_input_2_0_1/_13699, roi_pooling_conv_1/strided_slice_157/stack, roi_pooling_conv_1/strided_slice_157/stack_1, loss_1/dense_regress_3_loss/strided_slice_2/stack_2)]]
	 [[{{node loss_1/dense_regress_3_loss/Mean_2/_14305}} = _Recv[client_terminated=false, recv_device="/job:localhost/replica:0/task:0/device:CPU:0", send_device="/job:localhost/replica:0/task:0/device:GPU:0", send_device_incarnation=1, tensor_name="edge_49135_loss_1/dense_regress_3_loss/Mean_2", tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:CPU:0"]()]]

What should I do about this?

the output_shape of model_rpn does not match model_rpn.train_on_batch(X, Y) Y argument

the following code in train_frcnn.py:

X, Y, img_data = next(data_gen_train)
loss_rpn = model_rpn.train_on_batch(X, Y)

the return value Y of next(data_gen_train) wrap y_rpn_cls and y_rpn_regr, meanwhile Y is the target of model_rpn.train_on_batch(X, Y).
my question is:
the output shape of model_rpn is [?, ?, ?, 9], [?, ?, ?, 36], but the shape of y_rpn_cls is [?, ?, ?, 18], y_rpn_regr is [?, ?, ?, 72]. why those shape does not match?

About validation set

I see you divide the data set into three parts, but you don't seem to be using the validation set during training.

Setting learning phase for inception_resnet_v2

This issue leads me to believe that I simply need to insert a bit of code into the classifier method under inception_resnet_v2.py but I don't know if this is necessary since it seemed fined training initially. It's only having this problem when predicting.

Traceback (most recent call last):
  File "test_frcnn.py", line 199, in <module>
    [P_cls, P_regr] = model_classifier_only.predict([F, ROIs])
  File "/Users/carnett/apps/python-virtual-environments/keras_fasterrcnn/lib/python2.7/site-packages/keras/engine/training.py", line 1573, in predict
    batch_size=batch_size, verbose=verbose)
  File "/Users/carnett/apps/python-virtual-environments/keras_fasterrcnn/lib/python2.7/site-packages/keras/engine/training.py", line 1203, in _predict_loop
    batch_outs = f(ins_batch)
  File "/Users/carnett/apps/python-virtual-environments/keras_fasterrcnn/lib/python2.7/site-packages/keras/backend/tensorflow_backend.py", line 2103, in __call__
    feed_dict=feed_dict)
  File "/Users/carnett/apps/python-virtual-environments/keras_fasterrcnn/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 950, in run
    run_metadata_ptr)
  File "/Users/carnett/apps/python-virtual-environments/keras_fasterrcnn/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 1173, in _run
    feed_dict_tensor, options, run_metadata)
  File "/Users/carnett/apps/python-virtual-environments/keras_fasterrcnn/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 1350, in _do_run
    run_metadata)
  File "/Users/carnett/apps/python-virtual-environments/keras_fasterrcnn/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 1370, in _do_call
    raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.InvalidArgumentError: You must feed a value for placeholder tensor 'Stem_block_conv1_bn/keras_learning_phase' with dtype bool
	 [[node Stem_block_conv1_bn/keras_learning_phase (defined at /Users/carnett/apps/python-virtual-environments/keras_fasterrcnn/lib/python2.7/site-packages/keras/backend/tensorflow_backend.py:103) ]]

Training fails after some epochs passed.

In the training phase, after some epoch, the following exception is thrown:
Traceback (most recent call last): File "train_frcnn.py", line 288, in <module> loss_class = model_classifier.train_on_batch([X, X2[:, sel_samples, :]], [Y1[:, sel_samples, :], Y2[:, sel_samples, :]]) File "/usr/local/lib/python2.7/dist-packages/keras/engine/training.py", line 1217, in train_on_batch outputs = self.train_function(ins) File "/usr/local/lib/python2.7/dist-packages/keras/backend/tensorflow_backend.py", line 2715, in __call__ return self._call(inputs) File "/usr/local/lib/python2.7/dist-packages/keras/backend/tensorflow_backend.py", line 2675, in _call fetched = self._callable_fn(*array_vals) File "/usr/local/lib/python2.7/dist-packages/tensorflow_core/python/client/session.py", line 1472, in __call__ run_metadata_ptr) tensorflow.python.framework.errors_impl.InvalidArgumentError: 2 root error(s) found. (0) Invalid argument: slice index 20 of dimension 1 out of bounds. [[{{node roi_pooling_conv_1/strided_slice_102}}]] [[loss_1/add/_811]] (1) Invalid argument: slice index 20 of dimension 1 out of bounds. [[{{node roi_pooling_conv_1/strided_slice_102}}]] 0 successful operations. 0 derived errors ignored.

Are there any solutions to this issue?

test_frcnn.py not working?

The result_img didn't contain the bounding box. And when I print out true_x, true_y , .v..vv.... It just an empty list. Is there any way I can fix this?

help

File "train_frcnn.py", line 261, in selected_neg_samples = np.rando

Dont finsh while loop

I tried train_frcnn.py use Python 3.5.2.
But, dont finish while loop

File "train_frcnn.py", line 224, in
X, Y, img_data = next(data_gen_train)
File "/home/user/Keras-FasterRCNN/keras_frcnn/data_generators.py", line 294, in get_anchor_gt
img_data_aug, x_img = data_augment.augment(img_data, C, augment=True)

In keras_frcnn/data_generators.py,
The train data set is read more and more.

help! it doesn't begin!

Using TensorFlow backend.
Parsing annotation files
Processing 2012_002286.xml: 100%|███████| 17125/17125 [00:08<00:00, 1933.86it/s]
Training images per class:
{'aeroplane': 954,
'bg': 0,
'bicycle': 790,
'bird': 1221,
'boat': 999,
'bottle': 1482,
'bus': 637,
'car': 2364,
'cat': 1227,
'chair': 2906,
'cow': 702,
'diningtable': 747,
'dog': 1541,
'horse': 750,
'motorbike': 751,
'person': 10129,
'pottedplant': 1099,
'sheep': 994,
'sofa': 786,
'train': 656,
'tvmonitor': 826}
Num classes (including bg) = 21
Config has been written to config.pickle, and can be loaded when testing to ensure correct results
Num train samples 0
Num test samples 0
loading weights from resnet50_weights_tf_dim_ordering_tf_kernels.h5
Could not load pretrained model weights. Weights can be found in the keras application folder https://github.com/fchollet/keras/tree/master/keras/applications
2020-04-30 12:17:02.208461: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
2020-04-30 12:17:02.315812: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:964] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2020-04-30 12:17:02.316910: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1432] Found device 0 with properties:
name: GeForce GTX 1060 major: 6 minor: 1 memoryClockRate(GHz): 1.6705
pciBusID: 0000:01:00.0
totalMemory: 5.94GiB freeMemory: 5.60GiB
2020-04-30 12:17:02.316931: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1511] Adding visible gpu devices: 0
2020-04-30 12:17:02.716655: I tensorflow/core/common_runtime/gpu/gpu_device.cc:982] Device interconnect StreamExecutor with strength 1 edge matrix:
2020-04-30 12:17:02.716706: I tensorflow/core/common_runtime/gpu/gpu_device.cc:988] 0
2020-04-30 12:17:02.716718: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1001] 0: N
2020-04-30 12:17:02.717023: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1115] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 5375 MB memory) -> physical GPU (device: 0, name: GeForce GTX 1060, pci bus id: 0000:01:00.0, compute capability: 6.1)
Starting training
Epoch 1/2000
^CTraceback (most recent call last):
File "train_frcnn.py", line 220, in
X, Y, img_data = next(data_gen_train)
File "/home/chen/chen/Keras-FasterRCNN-master/keras_frcnn/data_generators.py", line 284, in get_anchor_gt
random.shuffle(all_img_data)
File "/home/chen/.virtualenvs/p3cv4/lib/python3.5/random.py", line 268, in shuffle
randbelow = self._randbelow
KeyboardInterrupt
(p3cv4) chen@chen-TM1705:~/chen/Keras-FasterRCNN-master$ python3 train_frcnn.py -p./pascalvoc
Using TensorFlow backend.
Parsing annotation files
Processing 2012_002286.xml: 100%|███████| 17125/17125 [00:08<00:00, 1960.77it/s]
Training images per class:
{'aeroplane': 954,
'bg': 0,
'bicycle': 790,
'bird': 1221,
'boat': 999,
'bottle': 1482,
'bus': 637,
'car': 2364,
'cat': 1227,
'chair': 2906,
'cow': 702,
'diningtable': 747,
'dog': 1541,
'horse': 750,
'motorbike': 751,
'person': 10129,
'pottedplant': 1099,
'sheep': 994,
'sofa': 786,
'train': 656,
'tvmonitor': 826}
Num classes (including bg) = 21
Config has been written to config.pickle, and can be loaded when testing to ensure correct results
Num train samples 0
Num test samples 0
loading weights from resnet50_weights_tf_dim_ordering_tf_kernels.h5
Could not load pretrained model weights. Weights can be found in the keras application folder https://github.com/fchollet/keras/tree/master/keras/applications
2020-04-30 12:25:23.276490: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
2020-04-30 12:25:23.400670: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:964] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2020-04-30 12:25:23.401476: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1432] Found device 0 with properties:
name: GeForce GTX 1060 major: 6 minor: 1 memoryClockRate(GHz): 1.6705
pciBusID: 0000:01:00.0
totalMemory: 5.94GiB freeMemory: 5.60GiB
2020-04-30 12:25:23.401493: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1511] Adding visible gpu devices: 0
2020-04-30 12:25:23.806395: I tensorflow/core/common_runtime/gpu/gpu_device.cc:982] Device interconnect StreamExecutor with strength 1 edge matrix:
2020-04-30 12:25:23.806431: I tensorflow/core/common_runtime/gpu/gpu_device.cc:988] 0
2020-04-30 12:25:23.806439: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1001] 0: N
2020-04-30 12:25:23.806763: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1115] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 5366 MB memory) -> physical GPU (device: 0, name: GeForce GTX 1060, pci bus id: 0000:01:00.0, compute capability: 6.1)
Starting training
Epoch 1/2000
and then there no progress bar? how can I do

no test.txt in VOC dataset

Hi

Traceback (most recent call last):
File "C:/PY_SOURCE2/RCNN/Keras-FasterRCNN-master/train_frcnn.py", line 99, in
all_imgs, classes_count, class_mapping = get_data(options.train_path)
File "C:\PY_SOURCE2\RCNN\Keras-FasterRCNN-master\keras_frcnn\pascal_voc_parser.py", line 46, in get_data
with open(imgsets_path_test) as f:
FileNotFoundError: [Errno 2] No such file or directory: 'F:\VOCdevkit\VOC2012\ImageSets\Main\test.txt'

2018-10-02_034448

Pretrained Weights

Did you check the model's performance on Pascal VOC? If yes, can you please provide the pretrained weights for the same, for those who don't want to retrain the model.

Also, do you have pretrained weights for the same model on MS COCO dataset? That would also be helpful.

precise problem

I use keras-faster rcnn train voc2007 dataset,and have train 200 epochs.then Imeasure the map,only have 0.15.could you tell me how to slove this problem?,I look at the picture,have many detect error.

what does get_img_output_length() means?

this is your code:
def get_img_output_length(width, height):
def get_output_length(input_length):
# filter_sizes = [3, 3, 3, 3, 3, 3, 3]
# strides = [2, 1, 2, 1, 2, 2, 2]
filter_sizes = [3, 3, 3, 3, 3, 3]
strides = [2, 1, 2, 1, 2, 2]

    assert len(filter_sizes) == len(strides)

    for i in range(len(filter_sizes)):
        input_length = (input_length - filter_sizes[i]) // strides[i] + 1

    return input_length

return get_output_length(width), get_output_length(height)

what does it means?
slides the 3*3 window on feature map?

How to configure xception and use it?

How do you use xception as network instead of resnet 50? How do you configure it? I've tried to use xception as network, but when I test it the result images show no label and prediction. Thank you

Unable to train using GPU?

/home/wangyongjun/iPSCs_Image_Analysis/venv_conda/bin/python /home/wangyongjun/iPSCs_Image_Analysis/iPSCs_detection/train_frcnn.py
Using TensorFlow backend.
2019-07-02 14:24:19.841527: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
2019-07-02 14:24:19.877597: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 2100075000 Hz
2019-07-02 14:24:19.880423: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x5604d4ba2550 executing computations on platform Host. Devices:
2019-07-02 14:24:19.880495: I tensorflow/compiler/xla/service/service.cc:175] StreamExecutor device (0): ,
2019-07-02 14:24:19.882778: I tensorflow/stream_executor/platform/default/dso_loader.cc:42] Successfully opened dynamic library libcuda.so.1
2019-07-02 14:24:20.412817: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1640] Found device 0 with properties:
name: TITAN Xp major: 6 minor: 1 memoryClockRate(GHz): 1.582
pciBusID: 0000:02:00.0
2019-07-02 14:24:20.413880: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1640] Found device 1 with properties:
name: TITAN Xp major: 6 minor: 1 memoryClockRate(GHz): 1.582
pciBusID: 0000:03:00.0
2019-07-02 14:24:20.414813: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1640] Found device 2 with properties:
name: TITAN Xp major: 6 minor: 1 memoryClockRate(GHz): 1.582
pciBusID: 0000:82:00.0
2019-07-02 14:24:20.415591: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1640] Found device 3 with properties:
name: TITAN Xp major: 6 minor: 1 memoryClockRate(GHz): 1.582
pciBusID: 0000:83:00.0
2019-07-02 14:24:20.415749: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Could not dlopen library 'libcudart.so.10.0'; dlerror: libcudart.so.10.0: cannot open shared object file: No such file or directory
2019-07-02 14:24:20.415816: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Could not dlopen library 'libcublas.so.10.0'; dlerror: libcublas.so.10.0: cannot open shared object file: No such file or directory
2019-07-02 14:24:20.415877: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Could not dlopen library 'libcufft.so.10.0'; dlerror: libcufft.so.10.0: cannot open shared object file: No such file or directory
2019-07-02 14:24:20.415936: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Could not dlopen library 'libcurand.so.10.0'; dlerror: libcurand.so.10.0: cannot open shared object file: No such file or directory
2019-07-02 14:24:20.415994: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Could not dlopen library 'libcusolver.so.10.0'; dlerror: libcusolver.so.10.0: cannot open shared object file: No such file or directory
2019-07-02 14:24:20.416064: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Could not dlopen library 'libcusparse.so.10.0'; dlerror: libcusparse.so.10.0: cannot open shared object file: No such file or directory
2019-07-02 14:24:20.416121: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Could not dlopen library 'libcudnn.so.7'; dlerror: libcudnn.so.7: cannot open shared object file: No such file or directory
2019-07-02 14:24:20.416130: W tensorflow/core/common_runtime/gpu/gpu_device.cc:1663] Cannot dlopen some GPU libraries. Skipping registering GPU devices...
2019-07-02 14:24:20.416272: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1181] Device interconnect StreamExecutor with strength 1 edge matrix:
2019-07-02 14:24:20.416282: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1187] 0 1 2 3
2019-07-02 14:24:20.416288: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1200] 0: N Y N N
2019-07-02 14:24:20.416293: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1200] 1: Y N N N
2019-07-02 14:24:20.416298: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1200] 2: N N N Y
2019-07-02 14:24:20.416303: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1200] 3: N N Y N
2019-07-02 14:24:20.431609: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x5604d68a4710 executing computations on platform CUDA. Devices:
2019-07-02 14:24:20.431633: I tensorflow/compiler/xla/service/service.cc:175] StreamExecutor device (0): TITAN Xp, Compute Capability 6.1
2019-07-02 14:24:20.431641: I tensorflow/compiler/xla/service/service.cc:175] StreamExecutor device (1): TITAN Xp, Compute Capability 6.1
2019-07-02 14:24:20.431648: I tensorflow/compiler/xla/service/service.cc:175] StreamExecutor device (2): TITAN Xp, Compute Capability 6.1
2019-07-02 14:24:20.431654: I tensorflow/compiler/xla/service/service.cc:175] StreamExecutor device (3): TITAN Xp, Compute Capability 6.1
[name: "/device:CPU:0"
device_type: "CPU"
memory_limit: 268435456
locality {
}
incarnation: 306929952179397883
, name: "/device:XLA_CPU:0"
device_type: "XLA_CPU"
memory_limit: 17179869184
locality {
}
incarnation: 2004709365230408661
physical_device_desc: "device: XLA_CPU device"
, name: "/device:XLA_GPU:0"
device_type: "XLA_GPU"
memory_limit: 17179869184
locality {
}
incarnation: 4768577020553090356
physical_device_desc: "device: XLA_GPU device"
, name: "/device:XLA_GPU:1"
device_type: "XLA_GPU"
memory_limit: 17179869184
locality {
}
incarnation: 8158160402508824678
physical_device_desc: "device: XLA_GPU device"
, name: "/device:XLA_GPU:2"
device_type: "XLA_GPU"
memory_limit: 17179869184
locality {
}
incarnation: 2994857638638946823
physical_device_desc: "device: XLA_GPU device"
, name: "/device:XLA_GPU:3"
device_type: "XLA_GPU"
memory_limit: 17179869184
locality {
}
incarnation: 9148773670435188
physical_device_desc: "device: XLA_GPU device"
]
Parsing annotation files
Processing 10_1.xml: 100%|����������| 3352/3352 [00:00<00:00, 4708.23it/s]
Training images per class:
{'Bad': 1827, 'Good': 3266, 'Medium': 2349, 'bg': 0}
Num classes (including bg) = 4
Config has been written to config.pickle, and can be loaded when testing to ensure correct results
Num train samples 1343
Num val samples 1001
Num test samples 1008
WARNING: Logging before flag parsing goes to stderr.
W0702 14:24:21.169176 140049300752128 deprecation_wrapper.py:119] From /home/wangyongjun/iPSCs_Image_Analysis/venv_conda/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py:47: The name tf.get_default_graph is deprecated. Please use tf.compat.v1.get_default_graph instead.

W0702 14:24:21.169825 140049300752128 deprecation_wrapper.py:119] From /home/wangyongjun/iPSCs_Image_Analysis/venv_conda/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py:351: The name tf.placeholder is deprecated. Please use tf.compat.v1.placeholder instead.

W0702 14:24:21.173986 140049300752128 deprecation_wrapper.py:119] From /home/wangyongjun/iPSCs_Image_Analysis/venv_conda/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py:3176: The name tf.random_uniform is deprecated. Please use tf.random.uniform instead.

W0702 14:24:21.204720 140049300752128 deprecation_wrapper.py:119] From /home/wangyongjun/iPSCs_Image_Analysis/venv_conda/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py:3043: The name tf.nn.max_pool is deprecated. Please use tf.nn.max_pool2d instead.

W0702 14:24:22.611183 140049300752128 deprecation_wrapper.py:119] From /home/wangyongjun/iPSCs_Image_Analysis/venv_conda/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py:3153: The name tf.random_normal is deprecated. Please use tf.random.normal instead.

W0702 14:24:22.656112 140049300752128 deprecation_wrapper.py:119] From /home/wangyongjun/iPSCs_Image_Analysis/iPSCs_detection/keras_frcnn/RoiPoolingConv.py:108: The name tf.image.resize_images is deprecated. Please use tf.image.resize instead.

W0702 14:24:23.809847 140049300752128 deprecation_wrapper.py:119] From /home/wangyongjun/iPSCs_Image_Analysis/venv_conda/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py:3045: The name tf.nn.avg_pool is deprecated. Please use tf.nn.avg_pool2d instead.

W0702 14:24:23.817028 140049300752128 deprecation.py:506] From /home/wangyongjun/iPSCs_Image_Analysis/venv_conda/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py:1064: calling reduce_prod_v1 (from tensorflow.python.ops.math_ops) with keep_dims is deprecated and will be removed in a future version.
Instructions for updating:
keep_dims is deprecated, use keepdims instead
loading weights from resnet50_weights_tf_dim_ordering_tf_kernels.h5
Could not load pretrained model weights. Weights can be found in the keras application folder https://github.com/fchollet/keras/tree/master/keras/applications
W0702 14:24:23.891306 140049300752128 deprecation_wrapper.py:119] From /home/wangyongjun/iPSCs_Image_Analysis/venv_conda/lib/python3.7/site-packages/keras/optimizers.py:675: The name tf.train.Optimizer is deprecated. Please use tf.compat.v1.train.Optimizer instead.

W0702 14:24:23.905168 140049300752128 deprecation_wrapper.py:119] From /home/wangyongjun/iPSCs_Image_Analysis/venv_conda/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py:2642: The name tf.log is deprecated. Please use tf.math.log instead.

W0702 14:24:23.909163 140049300752128 deprecation.py:323] From /home/wangyongjun/iPSCs_Image_Analysis/venv_conda/lib/python3.7/site-packages/tensorflow/python/ops/nn_impl.py:180: add_dispatch_support..wrapper (from tensorflow.python.ops.array_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Use tf.where in 2.0, which has the same broadcast rule as np.where
W0702 14:24:23.914963 140049300752128 deprecation.py:506] From /home/wangyongjun/iPSCs_Image_Analysis/venv_conda/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py:1046: calling reduce_sum_v1 (from tensorflow.python.ops.math_ops) with keep_dims is deprecated and will be removed in a future version.
Instructions for updating:
keep_dims is deprecated, use keepdims instead
2019-07-02 14:24:24.097984: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1640] Found device 0 with properties:
name: TITAN Xp major: 6 minor: 1 memoryClockRate(GHz): 1.582
pciBusID: 0000:02:00.0
2019-07-02 14:24:24.099081: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1640] Found device 1 with properties:
name: TITAN Xp major: 6 minor: 1 memoryClockRate(GHz): 1.582
pciBusID: 0000:03:00.0
2019-07-02 14:24:24.100209: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1640] Found device 2 with properties:
name: TITAN Xp major: 6 minor: 1 memoryClockRate(GHz): 1.582
pciBusID: 0000:82:00.0
2019-07-02 14:24:24.101056: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1640] Found device 3 with properties:
name: TITAN Xp major: 6 minor: 1 memoryClockRate(GHz): 1.582
pciBusID: 0000:83:00.0
2019-07-02 14:24:24.101211: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Could not dlopen library 'libcudart.so.10.0'; dlerror: libcudart.so.10.0: cannot open shared object file: No such file or directory
2019-07-02 14:24:24.101282: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Could not dlopen library 'libcublas.so.10.0'; dlerror: libcublas.so.10.0: cannot open shared object file: No such file or directory
2019-07-02 14:24:24.101395: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Could not dlopen library 'libcufft.so.10.0'; dlerror: libcufft.so.10.0: cannot open shared object file: No such file or directory
2019-07-02 14:24:24.101474: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Could not dlopen library 'libcurand.so.10.0'; dlerror: libcurand.so.10.0: cannot open shared object file: No such file or directory
2019-07-02 14:24:24.101539: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Could not dlopen library 'libcusolver.so.10.0'; dlerror: libcusolver.so.10.0: cannot open shared object file: No such file or directory
2019-07-02 14:24:24.101603: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Could not dlopen library 'libcusparse.so.10.0'; dlerror: libcusparse.so.10.0: cannot open shared object file: No such file or directory
2019-07-02 14:24:24.101686: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Could not dlopen library 'libcudnn.so.7'; dlerror: libcudnn.so.7: cannot open shared object file: No such file or directory
2019-07-02 14:24:24.101696: W tensorflow/core/common_runtime/gpu/gpu_device.cc:1663] Cannot dlopen some GPU libraries. Skipping registering GPU devices...
2019-07-02 14:24:24.101857: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1181] Device interconnect StreamExecutor with strength 1 edge matrix:
2019-07-02 14:24:24.101868: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1187] 0 1 2 3
2019-07-02 14:24:24.101874: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1200] 0: N Y N N
2019-07-02 14:24:24.101879: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1200] 1: Y N N N
2019-07-02 14:24:24.101885: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1200] 2: N N N Y
2019-07-02 14:24:24.101890: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1200] 3: N N Y N
2019-07-02 14:24:24.747706: W tensorflow/compiler/jit/mark_for_compilation_pass.cc:1412] (One-time warning): Not using XLA:CPU for cluster because envvar TF_XLA_FLAGS=--tf_xla_cpu_global_jit was not set. If you want XLA:CPU, either set that envvar, or use experimental_jit_scope to enable XLA:CPU. To confirm that XLA is active, pass --vmodule=xla_compilation_cache=1 (as a proper command-line flag, not via TF_XLA_FLAGS) or set the envvar XLA_FLAGS=--xla_hlo_profile.
W0702 14:24:24.847111 140049300752128 deprecation_wrapper.py:119] From /home/wangyongjun/iPSCs_Image_Analysis/venv_conda/lib/python3.7/site-packages/keras/callbacks.py:646: The name tf.summary.merge_all is deprecated. Please use tf.compat.v1.summary.merge_all instead.

W0702 14:24:24.847523 140049300752128 deprecation_wrapper.py:119] From /home/wangyongjun/iPSCs_Image_Analysis/venv_conda/lib/python3.7/site-packages/keras/callbacks.py:649: The name tf.summary.FileWriter is deprecated. Please use tf.compat.v1.summary.FileWriter instead.

Exception a must be non-empty

This exception pops up during training, but the training proceeds and the loss decreases as expected. What does the exception refer to, and is it a problem? Thanks.

the mAP of the model

What is the mAP of the model you trained on VOC2007? I have trained the model 1000 epoch, but the mAP is only 43.2%

Background sample

So If i want to give a background sample, my .txt file should contain the following right:

img_path1,x1,x2,y1,y2,cat
img_path2,,,,,bg

??

Training can not start

Hi,
I'm using the gpu to run the train_frcnn.py. But it cannot start even at the beginning of epoch 1.
When I kill the training, it always stop inside the line X, Y, img_data = next(data_gen_train), shown as below.

Epoch 1/50
Traceback (most recent call last):
  File "train_frcnn.py", line 228, in <module>
    X, Y, img_data = next(data_gen_train)
  File "Keras-FasterRCNN/keras_frcnn/data_generators.py", line 309, in get_anchor_gt
    x_img = cv2.resize(x_img, (resized_width, resized_height), interpolation=cv2.INTER_CUBIC)
KeyboardInterrupt

Can anyone figure out the reason? Thank you.

Training stuck at epoch 1/20

I am using the Inception Resnet backbone and it's been almost 3 hrs and the training is still stuck at the first epoch without any progress. Can anyone please advise? I am training on my own dataset

Wrong type of imageset in simple_parser

in file simple_parser.py, line 43 is:

                    all_imgs[filename]['imageset'] = 'trainval'
                else:
                    all_imgs[filename]['imageset'] = 'test'

so the attribute imageset is trainval for training set. But in the main file train_frcnn.py line 124 is

train_imgs = [s for s in all_imgs if s['imageset'] == 'train']

So train_imgs gets no sample. Does it a bug or the author has another idea?

ValueError: Dimension 2 in both shapes must be equal, but are 1024 and 1088. Shapes are [1,1,1024,256] and [1,1,1088,256]. for 'Assign_690' (op: 'Assign') with input shapes: [1,1,1024,256], [1,1,1088,256]

When I train and test on resnet50 model, it works well.
And when I train on inception_resnet_v2 model, it works well.
But when I test on inception_resnet_v2 model, it raise an error: ValueError: Dimension 2 in both shapes must be equal, but are 1024 and 1088. Shapes are [1,1,1024,256] and [1,1,1088,256]. for 'Assign_690' (op: 'Assign') with input shapes: [1,1,1024,256], [1,1,1088,256].

ValueError: a must be non-empty

823/1000 [=======================>......] - ETA: 3:08 - rpn_cls: 2.9711 - rpn_regr: 0.0832 - detector_cls: 0.3042 - detector_regr: 0.1486Traceback (most recent call last):
File "train_frcnn.py", line 261, in
selected_neg_samples = np.random.choice(neg_samples, C.num_rois - len(selected_pos_samples), replace=False).tolist()
File "mtrand.pyx", line 1126, in mtrand.RandomState.choice
ValueError: a must be non-empty

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "train_frcnn.py", line 263, in
selected_neg_samples = np.random.choice(neg_samples, C.num_rois - len(selected_pos_samples), replace=True).tolist()
File "mtrand.pyx", line 1126, in mtrand.RandomState.choice
ValueError: a must be non-empty

Deploying Faster RCNN on Android device?

This is a question rather than an issue. I am planning to deploy Faster RCNN to an android device for running inference on camera feed. For that purpose, I converted the Keras models to Tensorflow models. In the testing script, there are some post-processing steps involved after running inference on RPN and Classifier. Questions:

  • It seems possible to deploy and run inference on an Android device but the real question is are these post-processing of the tensors supported by the Java environment in Android?
  • If the answer to first question is no, do you guys think it is possible to embed these post processing steps to neural network's output layer's logic so that the output we get is the final output rather than an output that needs processing?

Any suggestions/answers on this matter is appreciated.

measure_map

I have a new test.txt to get the mAp , but when I add this path to measure_map.py
The error is :TypeError:non_max_suppression_fast() got multiple values for argument 'overlap_thresh';
Who can tell me the correct step ?

F1-score loss for RRN

I am trying to implement F1-score loss for the RPN's classification head, but the loss is stuck at ~0.9993782699 during training. here is my implementation:

def rpn_loss_cls_F_one(num_anchors):
        def rpn_loss_cls(y_true, y_pred):
                if K.image_dim_ordering() == 'tf':                        

                        tp = K.sum(K.cast( y_true[:, :, :, :num_anchors] * y_pred[:, :, :, :], 'float'), axis=0)
                        fp = K.sum(K.cast((1-y_true[:, :, :, :num_anchors])* y_pred[:, :, :, :], 'float'), axis=0)
                        fn = K.sum(K.cast(y_true[:, :, :, :num_anchors]*(1- y_pred[:, :, :, :]), 'float'), axis=0)

                        p = (tp / (tp + fp + K.epsilon()))
                        r = (tp / (tp + fn + K.epsilon())) 

                        f1 = 2*p*r / (p+r+K.epsilon())
                        f1 = tf.where(tf.is_nan(f1), tf.zeros_like(f1), f1)
                        return 1 - K.mean(f1)


        return rpn_loss_cls

Is my implementation correct? if so, what possible reasons can I further look into to explain this strange loss behaviour during the training?

Thanks :)

RoiPooling with batch_size > 1

Hi! According to with the comments, the RoiPooling layer works with input size (1, rows, cols, channels), does that mean that it only works with batch_size = 1, or can it be higher ((batch_size, rows, cols, channels))?
Thanks in advance

Can i get a real-time demo python file?

test_frcnn.py is working well.. but it is a image detection code.
I want to real-time object detection demo python file..(webcam or video file)
anyone who knows the answer?

train error

I had this problem during training. And what's wrong with this, please? Thanks.
`Traceback (most recent call last):
File "/opt/anaconda3/envs/py36/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1334, in _do_call
return fn(*args)
File "/opt/anaconda3/envs/py36/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1319, in _run_fn
options, feed_dict, fetch_list, target_list, run_metadata)
File "/opt/anaconda3/envs/py36/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1407, in _call_tf_sessionrun
run_metadata)
tensorflow.python.framework.errors_impl.InvalidArgumentError: slice index 30 of dimension 1 out of bounds.
[[{{node roi_pooling_conv_1/strided_slice_152}}]]
[[{{node add_22}}]]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "train_frcnn.py", line 286, in
loss_class = model_classifier.train_on_batch([X, X2[:, sel_samples, :]], [Y1[:, sel_samples, :], Y2[:, sel_samples, :]])
File "/media/disk/wudi/.local/lib/python3.6/site-packages/keras/engine/training.py", line 1621, in train_on_batch
outputs = self.train_function(ins)
File "/media/disk/wudi/.local/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py", line 2103, in call
feed_dict=feed_dict)
File "/opt/anaconda3/envs/py36/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 929, in run
run_metadata_ptr)
File "/opt/anaconda3/envs/py36/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1152, in _run
feed_dict_tensor, options, run_metadata)
File "/opt/anaconda3/envs/py36/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1328, in _do_run
run_metadata)
File "/opt/anaconda3/envs/py36/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1348, in _do_call
raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.InvalidArgumentError: slice index 30 of dimension 1 out of bounds.
[[node roi_pooling_conv_1/strided_slice_152 (defined at /media/disk/wudi/Keras-FasterRCNN-master/keras_frcnn/RoiPoolingConv.py:67) ]]
[[node add_22 (defined at /media/disk/wudi/.local/lib/python3.6/site-packages/keras/engine/training.py:906) ]]

Caused by op 'roi_pooling_conv_1/strided_slice_152', defined at:
File "train_frcnn.py", line 157, in
classifier = nn.classifier(shared_layers, roi_input, C.num_rois, nb_classes=len(classes_count), trainable=True)
File "/media/disk/wudi/Keras-FasterRCNN-master/keras_frcnn/resnet.py", line 245, in classifier
out_roi_pool = RoiPoolingConv(pooling_regions, num_rois)([base_layers, input_rois])
File "/media/disk/wudi/.local/lib/python3.6/site-packages/keras/engine/topology.py", line 578, in call
output = self.call(inputs, **kwargs)
File "/media/disk/wudi/Keras-FasterRCNN-master/keras_frcnn/RoiPoolingConv.py", line 67, in call
w = rois[0, roi_idx, 2]
File "/opt/anaconda3/envs/py36/lib/python3.6/site-packages/tensorflow/python/ops/array_ops.py", line 654, in _slice_helper
name=name)
File "/opt/anaconda3/envs/py36/lib/python3.6/site-packages/tensorflow/python/ops/array_ops.py", line 820, in strided_slice
shrink_axis_mask=shrink_axis_mask)
File "/opt/anaconda3/envs/py36/lib/python3.6/site-packages/tensorflow/python/ops/gen_array_ops.py", line 9356, in strided_slice
shrink_axis_mask=shrink_axis_mask, name=name)
File "/opt/anaconda3/envs/py36/lib/python3.6/site-packages/tensorflow/python/framework/op_def_library.py", line 788, in _apply_op_helper
op_def=op_def)
File "/opt/anaconda3/envs/py36/lib/python3.6/site-packages/tensorflow/python/util/deprecation.py", line 507, in new_func
return func(*args, **kwargs)
File "/opt/anaconda3/envs/py36/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 3300, in create_op
op_def=op_def)
File "/opt/anaconda3/envs/py36/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 1801, in init
self._traceback = tf_stack.extract_stack()

InvalidArgumentError (see above for traceback): slice index 30 of dimension 1 out of bounds.
[[node roi_pooling_conv_1/strided_slice_152 (defined at /media/disk/wudi/Keras-FasterRCNN-master/keras_frcnn/RoiPoolingConv.py:67) ]]
[[node add_22 (defined at /media/disk/wudi/.local/lib/python3.6/site-packages/keras/engine/training.py:906) ]]
`

I am getting error during running training script. Error is : ValueError: Shape must be rank 1 but is rank 0 for 'bn_conv1/Reshape_4' (op: 'Reshape') with input shapes: [1,1,1,64], [].

Traceback (most recent call last):
File "C:\Users\Tharun Raj\Anaconda3\lib\site-packages\tensorflow\python\framework\ops.py", line 1659, in _create_c_op
c_op = c_api.TF_FinishOperation(op_desc)
tensorflow.python.framework.errors_impl.InvalidArgumentError: Shape must be rank 1 but is rank 0 for 'bn_conv1/Reshape_4' (op: 'Reshape') with input shapes: [1,1,1,64], [].

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File ".\train_frcnn.py", line 147, in
shared_layers = nn.nn_base(img_input, trainable=True)
File "F:\Parth\Keras-FasterRCNN\keras_frcnn\resnet.py", line 185, in nn_base
x = FixedBatchNormalization(axis=bn_axis, name='bn_conv1')(x)
File "C:\Users\Tharun Raj\Anaconda3\lib\site-packages\keras\engine\base_layer.py", line 457, in call
output = self.call(inputs, **kwargs)
File "F:\Parth\Keras-FasterRCNN\keras_frcnn\FixedBatchNormalization.py", line 73, in call
epsilon=self.epsilon)
File "C:\Users\Tharun Raj\Anaconda3\lib\site-packages\keras\backend\tensorflow_backend.py", line 1908, in batch_normalization
mean = tf.reshape(mean, (-1))
File "C:\Users\Tharun Raj\Anaconda3\lib\site-packages\tensorflow\python\ops\gen_array_ops.py", line 7178, in reshape
"Reshape", tensor=tensor, shape=shape, name=name)
File "C:\Users\Tharun Raj\Anaconda3\lib\site-packages\tensorflow\python\framework\op_def_library.py", line 788, in _apply_op_helper
op_def=op_def)
File "C:\Users\Tharun Raj\Anaconda3\lib\site-packages\tensorflow\python\util\deprecation.py", line 507, in new_func
return func(*args, **kwargs)
File "C:\Users\Tharun Raj\Anaconda3\lib\site-packages\tensorflow\python\framework\ops.py", line 3300, in create_op
op_def=op_def)
File "C:\Users\Tharun Raj\Anaconda3\lib\site-packages\tensorflow\python\framework\ops.py", line 1823, in init
control_input_ops)
File "C:\Users\Tharun Raj\Anaconda3\lib\site-packages\tensorflow\python\framework\ops.py", line 1662, in _create_c_op
raise ValueError(str(e))
ValueError: Shape must be rank 1 but is rank 0 for 'bn_conv1/Reshape_4' (op: 'Reshape') with input shapes: [1,1,1,64], [].

RoiPoolingConv input format

Hi! I would like to know the format that the ROI patches should have in the RoiPoolingConv Layer. According to the comments, it's (x,y,w,h), but I don't know if x,y is the center of the image or a corner. Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.