Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

problem in creating dataset_train and dataset_val #1

Open
Siwar11 opened this issue Mar 19, 2019 · 8 comments
Open

problem in creating dataset_train and dataset_val #1

Siwar11 opened this issue Mar 19, 2019 · 8 comments
Labels
question Further information is requested

Comments

@Siwar11
Copy link

Siwar11 commented Mar 19, 2019

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
Copy link
Collaborator

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

@Siwar11
Copy link
Author

Siwar11 commented Mar 19, 2019 via email

@JaeungHyun
Copy link
Collaborator

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

@Siwar11
Copy link
Author

Siwar11 commented Mar 19, 2019 via email

@JaeungHyun
Copy link
Collaborator

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!

@JaeungHyun JaeungHyun added the question Further information is requested label Mar 19, 2019
@Siwar11
Copy link
Author

Siwar11 commented Mar 19, 2019 via email

@Siwar11
Copy link
Author

Siwar11 commented Mar 19, 2019 via email

@JaeungHyun JaeungHyun added good first issue Good for newcomers and removed good first issue Good for newcomers labels Mar 19, 2019
@JaeungHyun
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants