pknu-wap / UnderTheSea

Fish instance segmentation using Mask-RCNN
GNU General Public License v3.0
36 stars 8 forks source link

problem in creating dataset_train and dataset_val #1

Open Siwar11 opened 5 years ago

Siwar11 commented 5 years ago

in fish_detection.ipynb dataset_train, dataset_val = det.create_datasets(dataset_path+"\train", config)

I found this error please help me JSONDecodeError Traceback (most recent call last)

in 1 # Load dataset 2 ## annotations파일을 불러와서 클래스 구분되는 이름을 가져온다. ----> 3 dataset_train, dataset_val = det.create_datasets(dataset_path+"\\train", config) 4 ~\Downloads\UnderTheSea-master\fish_project\det.py in create_datasets(dataset_dir, config, train_pct) 319 """ 320 --> 321 train_ann, val_ann = split_annotations(dataset_dir, config, train_pct=train_pct) 322 323 print(annotation_stats(train_ann)) ~\Downloads\UnderTheSea-master\fish_project\det.py in split_annotations(dataset_dir, config, train_pct, annotation_filename, randomize) 251 252 # Load annotations --> 253 annotations = json.load(open(os.path.join(dataset_dir, annotation_filename))) 254 annotations = list(annotations.values()) 255 ~\Miniconda3\envs\tensorflow\lib\json\__init__.py in load(fp, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, **kw) 297 cls=cls, object_hook=object_hook, 298 parse_float=parse_float, parse_int=parse_int, --> 299 parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw) 300 301 ~\Miniconda3\envs\tensorflow\lib\json\__init__.py in loads(s, encoding, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, **kw) 352 parse_int is None and parse_float is None and 353 parse_constant is None and object_pairs_hook is None and not kw): --> 354 return _default_decoder.decode(s) 355 if cls is None: 356 cls = JSONDecoder ~\Miniconda3\envs\tensorflow\lib\json\decoder.py in decode(self, s, _w) 337 338 """ --> 339 obj, end = self.raw_decode(s, idx=_w(s, 0).end()) 340 end = _w(s, end).end() 341 if end != len(s): ~\Miniconda3\envs\tensorflow\lib\json\decoder.py in raw_decode(self, s, idx) 355 obj, end = self.scan_once(s, idx) 356 except StopIteration as err: --> 357 raise JSONDecodeError("Expecting value", s, err.value) from None 358 return obj, end JSONDecodeError: Expecting value: line 1 column 1 (char 0)
JaeungHyun commented 5 years ago

Do you have annotations.json or formatting of JSON file is right?

Siwar11 commented 5 years ago

yes already exist

Le mar. 19 mars 2019 à 11:08, JaeUng Hyun notifications@github.com a écrit :

Do you have annotations.json or formatting of JSON file is right?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/pknu-wap/UnderTheSea/issues/1#issuecomment-474281872, or mute the thread https://github.com/notifications/unsubscribe-auth/As2ht_ks7fGpKKWEr38EP0kKLhg7BWN1ks5vYLc7gaJpZM4b7sTU .

JaeungHyun commented 5 years ago

Error message said there is problem in JSON file. Did you check directory path of dataset?

Siwar11 commented 5 years ago

in fact there was another problem maybe it has relation with this... i work with miniconda3 python3.6(tensorflow) and jupyter notebook and when i sart running fish_detection.ipynb i had problem with downlowding google colab it distrupt my jupyter notebook installation so i uninstall it and re install it and it work again normally and i skiped the google colab block so i was obliged to creat my own paths : i creat in images folder an "fish" folder where the "train" folder were created

Le mar. 19 mars 2019 à 11:36, JaeUng Hyun notifications@github.com a écrit :

Error message said there is problem in JSON file. Did you check directory path of dataset?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/pknu-wap/UnderTheSea/issues/1#issuecomment-474297085, or mute the thread https://github.com/notifications/unsubscribe-auth/As2ht42ix7LxoGo7cvjLIz7Kqs6A-uPVks5vYL26gaJpZM4b7sTU .

JaeungHyun commented 5 years ago

Oh, I didn't write my system. I'm running on Mac, using python 3.6.8, Tensorflow 1.13.1 through anaconda3. My code is working well on Colab and my laptop.

When you make dataset from annotation file, images and annotations file should be in /fish_project/images/fish.

Good luck!

Siwar11 commented 5 years ago

Load dataset

annotations파일을 불러와서 클래스 구분되는 이름을 가져온다.

dataset_train, dataset_val = det.create_datasets('C:\Users\OctaNet\Miniconda3\UnderTheSea-master\fish_project\images\fish'+"\train", config)

i had this error: fish_detection

---------------------------------------------------------------------------JSONDecodeError Traceback (most recent call last) in 1 # Load dataset 2 ## annotations파일을 불러와서 클래스 구분되는 이름을 가져온다.----> 3 dataset_train, dataset_val = det.create_datasets('C:\Users\OctaNet\Miniconda3\UnderTheSea-master\fish_project\images\fish'+"\train", config) 4 ~\Miniconda3\UnderTheSea-master\fish_project\det.py in create_datasets(dataset_dir, config, train_pct) 319 """ 320 --> 321 train_ann, val_ann = split_annotations(dataset_dir, config, train_pct=train_pct) 322 323 print(annotation_stats(train_ann)) ~\Miniconda3\UnderTheSea-master\fish_project\det.py in split_annotations(dataset_dir, config, train_pct, annotation_filename, randomize) 251 252 # Load annotations--> 253 annotations = json.load(open(os.path.join(dataset_dir, annotation_filename))) 254 annotations = list(annotations.values()) 255 ~\Miniconda3\envs\tensorflow\lib\json__init.py in load(fp, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, kw) 297 cls=cls, object_hook=object_hook, 298 parse_float=parse_float, parse_int=parse_int,--> 299 parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, kw) 300 301 ~\Miniconda3\envs\tensorflow\lib\json\init__.py in loads(s, encoding, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, **kw) 352 parse_int is None and parse_float is None and 353 parse_constant is None and object_pairs_hook is None and not kw):--> 354 return _default_decoder.decode(s) 355 if cls is None: 356 cls = JSONDecoder ~\Miniconda3\envs\tensorflow\lib\json\decoder.py in decode(self, s, _w) 337 338 """--> 339 obj, end = self.raw_decode(s, idx=_w(s, 0).end()) 340 end = _w(s, end).end() 341 if end != len(s): ~\Miniconda3\envs\tensorflow\lib\json\decoder.py in raw_decode(self, s, idx) 355 obj, end = self.scan_once(s, idx) 356 except StopIteration as err:--> 357 raise JSONDecodeError("Expecting value", s, err.value) from None 358 return obj, end JSONDecodeError: Expecting value: line 1 column 1 (char 0)

[image: image.png]

Le mar. 19 mars 2019 à 12:04, JaeUng Hyun notifications@github.com a écrit :

Oh, I didn't write my system. I'm running on Mac, using python 3.6.8, Tensorflow 1.13.1 through anaconda3. My code is working well on Colab and my laptop.

When you make dataset from annotation file, images and annotations file should be in /fish_project/images/fish.

Good luck!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/pknu-wap/UnderTheSea/issues/1#issuecomment-474309032, or mute the thread https://github.com/notifications/unsubscribe-auth/As2ht_ATP0XOrvLvKIuqzYThOROC5_Uvks5vYMRKgaJpZM4b7sTU .

Siwar11 commented 5 years ago

[image: image.png]

Le mar. 19 mars 2019 à 14:40, chbil siwar chbilsiwar1@gmail.com a écrit :

Load dataset

annotations파일을 불러와서 클래스 구분되는 이름을 가져온다.

dataset_train, dataset_val = det.create_datasets('C:\Users\OctaNet\Miniconda3\UnderTheSea-master\fish_project\images\fish'+"\train", config)

i had this error: fish_detection

---------------------------------------------------------------------------JSONDecodeError Traceback (most recent call last) in 1 # Load dataset 2 ## annotations파일을 불러와서 클래스 구분되는 이름을 가져온다.----> 3 dataset_train, dataset_val = det.create_datasets('C:\Users\OctaNet\Miniconda3\UnderTheSea-master\fish_project\images\fish'+"\train", config) 4 ~\Miniconda3\UnderTheSea-master\fish_project\det.py in create_datasets(dataset_dir, config, train_pct) 319 """ 320 --> 321 train_ann, val_ann = split_annotations(dataset_dir, config, train_pct=train_pct) 322 323 print(annotation_stats(train_ann)) ~\Miniconda3\UnderTheSea-master\fish_project\det.py in split_annotations(dataset_dir, config, train_pct, annotation_filename, randomize) 251 252 # Load annotations--> 253 annotations = json.load(open(os.path.join(dataset_dir, annotation_filename))) 254 annotations = list(annotations.values()) 255 ~\Miniconda3\envs\tensorflow\lib\json__init.py in load(fp, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, kw) 297 cls=cls, object_hook=object_hook, 298 parse_float=parse_float, parse_int=parse_int,--> 299 parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, kw) 300 301 ~\Miniconda3\envs\tensorflow\lib\json\init__.py in loads(s, encoding, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, **kw) 352 parse_int is None and parse_float is None and 353 parse_constant is None and object_pairs_hook is None and not kw):--> 354 return _default_decoder.decode(s) 355 if cls is None: 356 cls = JSONDecoder ~\Miniconda3\envs\tensorflow\lib\json\decoder.py in decode(self, s, _w) 337 338 """--> 339 obj, end = self.raw_decode(s, idx=_w(s, 0).end()) 340 end = _w(s, end).end() 341 if end != len(s): ~\Miniconda3\envs\tensorflow\lib\json\decoder.py in raw_decode(self, s, idx) 355 obj, end = self.scan_once(s, idx) 356 except StopIteration as err:--> 357 raise JSONDecodeError("Expecting value", s, err.value) from None 358 return obj, end JSONDecodeError: Expecting value: line 1 column 1 (char 0)

[image: image.png]

Le mar. 19 mars 2019 à 12:04, JaeUng Hyun notifications@github.com a écrit :

Oh, I didn't write my system. I'm running on Mac, using python 3.6.8, Tensorflow 1.13.1 through anaconda3. My code is working well on Colab and my laptop.

When you make dataset from annotation file, images and annotations file should be in /fish_project/images/fish.

Good luck!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/pknu-wap/UnderTheSea/issues/1#issuecomment-474309032, or mute the thread https://github.com/notifications/unsubscribe-auth/As2ht_ATP0XOrvLvKIuqzYThOROC5_Uvks5vYMRKgaJpZM4b7sTU .

JaeungHyun commented 5 years ago

I don't know why it doesn't work. It is work well in my laptop.