一、源码
{
"mode" : "sr" ,
"use_cl" : true,
"gpu_ids" : [ 0 , 1 ] ,
"scale" : ,
"is_train" : true,
"use_chop" : true,
"rgb_range" : 255 ,
"self_ensemble" : false,
"save_image" : false,
"datasets" : {
"train" : {
"mode" : "LRHR" ,
"dataroot_HR" : "./datasets/Augment/Infra_train_HR_aug/x4" ,
"dataroot_LR" : "./datasets/Augment/Infra_train_LR_aug/x4" ,
"data_type" : "npy" ,
"n_workers" : 4 ,
"batch_size" : 16 ,
"LR_size" : 40 ,
"use_flip" : true,
"use_rot" : true,
"noise" : "."
} ,
"val" : {
"mode" : "LRHR" ,
"dataroot_HR" : "./datasets/Augment/Infra_val_HR_aug/x4" ,
"dataroot_LR" : "./datasets/Augment/Infra_val_LR_aug/LRBI/x4" ,
"data_type" : "img"
}
}
}
二、报错
Traceback ( most recent call last) :
File "train.py" , line 161 , in < module>
main( )
File "train.py" , line 24 , in main
opt = option. parse( opt)
File "/SRFBN_Boom/options/options.py" , line 23 , in parse
opt = json. loads( json_str, object_pairs_hook= OrderedDict)
File "/home/anaconda3/envs/IamComing/lib/python3.7/json/__init__.py" , line 361 , in loads
return cls( ** kw) . decode( s)
File "/home/anaconda3/envs/uIamComing/lib/python3.7/json/decoder.py" , line 337 , in decode
obj, end = self. raw_decode( s, idx= _w( s, 0 ) . end( ) )
File "/home/anaconda3/envs/IamComing/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 11 column 14 ( char 79 )
三、解决方案
```python
{
"mode" : "sr" ,
"use_cl" : true,
"gpu_ids" : [ 0 , 1 ] ,
"scale" : 4 ,
"is_train" : true,
"use_chop" : true,
"rgb_range" : 255 ,
"self_ensemble" : false,
"save_image" : false,
}
四、后续
RuntimeError: CUDA out of memory. Tried to allocate 20.00 MiB ( GPU 0 ; 10.76 GiB total capacity; 193.96 MiB already allocated; 6.44 MiB free; 16.04 MiB cached)