Import dgl:json.decoder.JSONDecodeError: Extra data: line 2 column 1 (char 23)

(torch116_py37) C:\Users\Administrator>python
Python 3.7.1 (default, Oct 28 2018, 08:39:03) [MSC v.1912 64 bit (AMD64)] :: Anaconda, Inc. on win32
Type “help”, “copyright”, “credits” or “license” for more information.

import dgl
Traceback (most recent call last):
File “”, line 1, in
File “F:\ljj\soft_install\Anaconda3\envs\torch116_py37\lib\site-packages\dgl_init_.py”, line 14, in
from .backend import backend_name, load_backend # usort: skip
File “F:\ljj\soft_install\Anaconda3\envs\torch116_py37\lib\site-packages\dgl\backend_init_.py”, line 122, in
load_backend(get_preferred_backend())
File “F:\ljj\soft_install\Anaconda3\envs\torch116_py37\lib\site-packages\dgl\backend_init_.py”, line 107, in get_preferred_backend
config_dict = json.load(config_file)
File “F:\ljj\soft_install\Anaconda3\envs\torch116_py37\lib\json_init_.py”, line 296, in load
parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)
File “F:\ljj\soft_install\Anaconda3\envs\torch116_py37\lib\json_init_.py”, line 348, in loads
return _default_decoder.decode(s)
File “F:\ljj\soft_install\Anaconda3\envs\torch116_py37\lib\json\decoder.py”, line 340, in decode
raise JSONDecodeError(“Extra data”, s, end)
json.decoder.JSONDecodeError: Extra data: line 2 column 1 (char 23)

the version:
python 3.7.1
pytorch 1.13.1 py3.7_cuda11.6_cudnn8_0 pytorch
pytorch-cuda 11.6 h867d48c_1 pytorch
cuda-nvcc 11.6.124 0 nvidia
cuda-nvdisasm 12.2.140 0 nvidia
dgl 1.1.2.cu116 py37_0 dglteam/label/cu116

Hi, sorry for the delayed reply. Could you check the config.json file under $HOME/.dgl? It should store the backend name like {"backend": "pytorch"}. The error shows that the file may be corrupted.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.