keras_frcnn
keras_frcnn copied to clipboard
Please Me.( /model/kitti_frcnn_last.hdf5)
Unable to open file (unable to open file: name = './model/kitti_frcnn_last.hdf5', errno = 2, error message = 'No such file or directory', flags = 0, o_flags = 0).
How to solve this problem? Where to get this file? Please help me figure it out.
Do you use the code directly on testing without training?In my opinion,the file named './model/kitti_frcnn_last.hdf5' is generated during training on your dataset.
When i run the training program (python train_frcnn_kitti.py), I have got an error message which was following
amori@fmg06[~/keras_frcnn]: python train_frcnn_kitti.py
Using TensorFlow backend.
Parsing annotation files
Traceback (most recent call last):
File "train_frcnn_kitti.py", line 256, in <module>
train_kitti()
File "train_frcnn_kitti.py", line 38, in train_kitti
all_images, classes_count, class_mapping = get_data(cfg.simple_label_file)
File "/lmb/home/amori/go/workspace/keras_frcnn/keras_frcnn/simple_parser.py", line 39, in get_data
(rows, cols) = img.shape[:2]
AttributeError: 'NoneType' object has no attribute 'shape'
Do you have any idea to solve this issue?
I am using those versions: Python 3.6.1 numpy 1.13.3 opencv-python 3.4.1.15
Thanks
Sorry, I figured it out. The problem was a path in kitti_simple_label.txt. Then, I have got the same issue the first person commented. (e.g. Unable to open file (Unable to open file: name = './model/kitti_frcnn_last.hdf5', errno = 2, error message = 'no such file or directory', flags = 0, o_flags = 0) Could not load pretrained model weights. Weights can be found in the keras application folder https://github.com/fchollet/keras/tree/master/keras/applications )
I jump into the github page, but there was no file kitti_frcnn_last.hdf5 in model directory (or there is no model directory)
Could you help me to figure this out?
Thanks
I have the same problem. Can you tell me how you solved it?
AttributeError: 'NoneType' object has no attribute 'shape'
When i run the training program (python train_frcnn_kitti.py), I have got an error message which was following
amori@fmg06[~/keras_frcnn]: python train_frcnn_kitti.py Using TensorFlow backend. Parsing annotation files Traceback (most recent call last): File "train_frcnn_kitti.py", line 256, in <module> train_kitti() File "train_frcnn_kitti.py", line 38, in train_kitti all_images, classes_count, class_mapping = get_data(cfg.simple_label_file) File "/lmb/home/amori/go/workspace/keras_frcnn/keras_frcnn/simple_parser.py", line 39, in get_data (rows, cols) = img.shape[:2] AttributeError: 'NoneType' object has no attribute 'shape'
Do you have any idea to solve this issue?
I am using those versions: Python 3.6.1 numpy 1.13.3 opencv-python 3.4.1.15
Thanks
It cannot read pic correctly cause the path is wrong! Go to change the path for pic in cfg.simple_label_file
Do you use the code directly on testing without training?In my opinion,the file named './model/kitti_frcnn_last.hdf5' is generated during training on your dataset.
Around line 97-109, you need to change cfg.model_path to cfg.base_net_weights to load pretrain weights.
cfg.model_path for output!!
As far as I understand, this is how it works:
-
cfg.model_path
points tomodel_trained/model_frcnn.vgg.hdf5
and is used to output the trained network or to load an existing network if you want to continue training it -
cfg.base_net_weights
points tomodel/resnet50_weights_tf_dim_ordering_tf_kernels.h5
. It is the base network for the classification network of Faster-RCNN. It should be downloaded from https://github.com/fchollet/deep-learning-models/releases/download/v0.2/resnet50_weights_tf_dim_ordering_tf_kernels.h5 and put in themodel
directory (create it if it doesn't exist). Then changemodel_classifier.load_weights(cfg.model_path, by_name=True)
tomodel_classifier.load_weights(cfg.base_net_weights, by_name=True)
intrain_frcnn_kitti.py
, line 94.
Please correct me if I'm wrong.
@Attila94 Model_classifier.load_weights should also be changed?
Sorry, I figured it out. The problem was a path in kitti_simple_label.txt. Then, I have got the same issue the first person commented. (e.g. Unable to open file (Unable to open file: name = './model/kitti_frcnn_last.hdf5', errno = 2, error message = 'no such file or directory', flags = 0, o_flags = 0) Could not load pretrained model weights. Weights can be found in the keras application folder https://github.com/fchollet/keras/tree/master/keras/applications )
I jump into the github page, but there was no file kitti_frcnn_last.hdf5 in model directory (or there is no model directory)
Could you help me to figure this out?
Thanks
how to solve The problem was a path in kitti_simple_label.txt.?
There are two issues to be determined.
One is to train the model. With regard to the training, it is necessary to download the dataset. Without downloading the dataset, it could not be trained. And it could generate the error as follows.
File ./keras_frcnn/keras_frcnn/simple_parser.py", line 34, in get_data (rows, cols) = img.shape[:2] AttributeError: 'NoneType' object has no attribute 'shape'
Another is related to either test or predict. With regard to the test or predict, it is necessary to have correct paths in the file of kitti_simple_label.txt by adoping the script of generate_simple_kitti_anno_file.py. Please notice the original kitti_simple_label.txt inlcudes the author's path as follows. If you use the author's txt file, it inevitably generate the error as follows.
OSError: Unable to open file (unable to open file: name = './model/kitti_frcnn_last.hdf5', errno = 2, error message = 'No such file or directory', flags = 0, o_flags = 0)
/media/jintian/Netac/Datasets/Kitti/object/training/image_2/000000.png,712.40,143.00,810.73,307.92,Pedestrian
Anyway, all the scripts of Keras_frcnn is quite old and obsolete. So it is hard to run the scripts. So I make it to adapt to Keras_frcnn adapt to Tensorflow 2.3 and Keras 2.4.