dbolya / yolact

A simple, fully convolutional model for real-time instance segmentation.
MIT License
5.03k stars 1.32k forks source link

JSONDecoder Error, At logger.py #710

Open udkii opened 2 years ago

udkii commented 2 years ago

Hello. I looked at other issues, but I don't think there are any issues that are the same as mine, so I'm writing this.

First of all, when I ran training last night, I increased the batch_size. (I have 4 3080Ti GPUs. originally I trained by batch_size of 8, then yesterday I increased it to 16). Then the computer suddenly lags and rebooted.

When I try to start learning again on the rebooted computer, I get this error from then on. There seems to be a remnant of a failed json file being created in training that was forced to quit.

Once I deleted the information about the session (33) that was killed by force from the .log file in logs. Even so, I keep getting an error in the logger.py file.

How can I solve this?


My Error Message is like this.

Traceback (most recent call last): File "train.py", line 526, in train() File "train.py", line 200, in train overwrite=(args.resume is None), log_gpu_stats=args.log_gpu) File "/home/user/yolact/utils/logger.py", line 56, in init self.session = json.loads(last)['session'] + 1 File "/home/user/anaconda3/envs/yolact-env/lib/python3.7/json/init.py", line 348, in loads return _default_decoder.decode(s) File "/home/user/anaconda3/envs/yolact-env/lib/python3.7/json/decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/home/user/anaconda3/envs/yolact-env/lib/python3.7/json/decoder.py", line 355, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 447 (char 446)

image


This is my log file looks like

Python 3.7.0 | packaged by conda-forge | (default, Nov 12 2018, 20:15:55) [GCC 7.3.0] :: Anaconda, Inc. on linux Type "help", "copyright", "credits" or "license" for more information.

from utils.logger import LogVisualizer vis = LogVisualizer() vis.sessions('logs/yolact_plus_resnet50_scaffold.log') Session 0: 1 entries | 0:00:00 elapsed Session 1: 1 entries | 0:00:00 elapsed Session 2: 1073 entries | 1:21:00 elapsed Session 3: 3847 entries | 4:24:18 elapsed Session 4: 1 entries | 0:00:00 elapsed Session 5: 13 entries | 0:00:49 elapsed Session 6: 12 entries | 0:07:07 elapsed Session 7: 11 entries | 0:01:53 elapsed Session 8: 1 entries | 0:00:00 elapsed Session 9: 1 entries | 0:00:00 elapsed Session 10: 1073 entries | 1:27:17 elapsed Session 11: 1073 entries | 1:14:55 elapsed Session 12: 1 entries | 0:00:00 elapsed Session 13: 1 entries | 0:00:00 elapsed Session 14: 302 entries | 0:53:32 elapsed Session 15: 64 entries | 0:05:13 elapsed Session 16: 1073 entries | 1:48:27 elapsed Session 17: 1073 entries | 1:26:23 elapsed Session 18: 869 entries | 1:01:14 elapsed Session 19: 25 entries | 0:01:12 elapsed Session 20: 2606 entries | 2:53:48 elapsed Session 21: 1271 entries | 1:36:10 elapsed Session 22: 2189 entries | 2:07:53 elapsed Session 23: 1 entries | 0:00:00 elapsed Session 24: 1 entries | 0:00:00 elapsed Session 25: 1 entries | 0:00:00 elapsed Session 26: 37 entries | 0:01:56 elapsed Session 27: 1 entries | 0:00:00 elapsed Session 28: 1 entries | 0:00:00 elapsed Session 29: 4 entries | 0:01:35 elapsed Session 30: 4 entries | 0:01:31 elapsed Session 31: 2189 entries | 2:42:15 elapsed Session 32: 588 entries | 0:46:29 elapsed

image

udkii commented 2 years ago

I modified the code to receive encoding as UTF-8, but it didn't solve.

I tried the try: , except: code as well, but got a NameError saying JSONDecoder could not be found.

Can anyone help, please?

linrui123 commented 2 years ago

maybe your log file has some error

HAMA-DL-dev commented 2 years ago

maybe your log file has some error

How did you know that? I tried ur suggestion, and corrected error