使用背景:
我想通过一个json格式传入一些参数范围,从而进行网格搜索,于是使用json.loads()进行加载,结果报错:
json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 1 column 2 (char 1)
出现这问题的原因是因为我使用了单引号,而非双引号。
{"n_components": [10, 15, 20, 25, 30], "learning_decay": [0.5, 0.7, 0.9] }