matterport / Mask_RCNN

Mask R-CNN for object detection and instance segmentation on Keras and TensorFlow
Other
24.7k stars 11.71k forks source link

Not able to Run Create Model and Load Trained weights module #272

Open swatinair123 opened 6 years ago

swatinair123 commented 6 years ago

Hi I am getting this following error as in the screen shot when i run ## Create Model and Load Trained Weights section .Please kindly advise what could be the issue and how to resolve screenshot

OSError Traceback (most recent call last)

in () 3 4 # Load weights trained on MS-COCO ----> 5 model.load_weights(COCO_MODEL_PATH, by_name=True) ~\MaskRCNN\Mask_RCNN\model.py in load_weights(self, filepath, by_name, exclude) 2015 if h5py is None: 2016 raise ImportError('`load_weights` requires h5py.') -> 2017 f = h5py.File(filepath, mode='r') 2018 if 'layer_names' not in f.attrs and 'model_weights' in f: 2019 f = f['model_weights'] c:\users\swati\anaconda\envs\maskrcnn\lib\site-packages\h5py\_hl\files.py in __init__(self, name, mode, driver, libver, userblock_size, swmr, **kwds) 267 with phil: 268 fapl = make_fapl(driver, libver, **kwds) --> 269 fid = make_fid(name, mode, userblock_size, fapl, swmr=swmr) 270 271 if swmr_support: c:\users\swati\anaconda\envs\maskrcnn\lib\site-packages\h5py\_hl\files.py in make_fid(name, mode, userblock_size, fapl, fcpl, swmr) 97 if swmr and swmr_support: 98 flags |= h5f.ACC_SWMR_READ ---> 99 fid = h5f.open(name, flags, fapl=fapl) 100 elif mode == 'r+': 101 fid = h5f.open(name, h5f.ACC_RDWR, fapl=fapl) h5py\_objects.pyx in h5py._objects.with_phil.wrapper() h5py\_objects.pyx in h5py._objects.with_phil.wrapper() h5py\h5f.pyx in h5py.h5f.open() OSError: Unable to open file (truncated file: eof = 153075712, sblock->base_addr = 0, stored_eof = 257557808)
alwansm commented 6 years ago

did you download the "mask_rcnn_coco.h5" and move it to Mask_RCNN_Master?

swatinair123 commented 6 years ago

Yes , But i am not getting the above error but when i give the donut image from the test images for Run object Detection its says

NameError Traceback (most recent call last)

in () 10 r = results[0] 11 visualize.display_instances(image, r['rois'], r['masks'], r['class_ids'], ---> 12 class_names, r['scores']) NameError: name 'class_names' is not defined Can you please help me with this
alwansm commented 6 years ago

if it's in the training section it should be "dataset_train.class_names" not "class_names"

swatinair123 commented 6 years ago

OK thanks a lot

On 22-Feb-2018 22:09, "Salwan" notifications@github.com wrote:

if it's in the training section it should be "dataset_train.class_names" not "class_names"

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/matterport/Mask_RCNN/issues/272#issuecomment-367741108, or mute the thread https://github.com/notifications/unsubscribe-auth/AWbURIWnq3RVCQHGMTQjyfYX6s6a-CRiks5tXZhBgaJpZM4SOxiY .

yiakwy commented 5 years ago

I have the same problem each time I load coco pretrained model after I clean the data. (rm mask_rcnn_coco.h5). Is the pretrained model corrupted ?

xiongshuai520 commented 5 years ago

I have the same problem and anybody answer it or handle it well?thanks a lot

xiongshuai520 commented 5 years ago

reload the coco.h5 dataset and it well be fine,Make sure the size of the data set is about 250M

Tun555 commented 4 years ago

i have problem anyone have been found?

from mrcnn.model import MaskRCNN NameError: name 'MaskRCNN' is not defined

parth-singh71 commented 4 years ago

Hey @Tun555 Maybe this might solve your issue, change directory to the root of your MaskRCNN project and then run python setup.py install in your terminal or cmd.