本地运行paddlehub.Module模块报错
homely杰 发布于2020-04-26 14:10 浏览:609 回复:3
0
收藏

module = hub.Module(name="resnet_v2_50_imagenet")

 

[2020-04-26 14:08:24,115] [ INFO] - Installing resnet_v2_50_imagenet module

JSONDecodeError Traceback (most recent call last)

in
----> 1 module = hub.Module(name="resnet_v2_50_imagenet")

d:\ProgramData\Anaconda3\lib\site-packages\paddlehub\module\module.py in __new__(cls, name, directory, module_dir, version, **kwargs)
100 if name:
101 module = cls.init_with_name(
--> 102 name=name, version=version, **kwargs)
103 elif directory:
104 module = cls.init_with_directory(directory=directory, **kwargs)

d:\ProgramData\Anaconda3\lib\site-packages\paddlehub\module\module.py in init_with_name(cls, name, version, **kwargs)
168 extra = {"command": "install"}
169 result, tips, module_dir = default_module_manager.install_module(
--> 170 module_name=name, module_version=version, extra=extra)
171 if not result:
172 logger.error(tips)

d:\ProgramData\Anaconda3\lib\site-packages\paddlehub\module\manager.py in install_module(self, module_name, module_dir, module_package, module_version, upgrade, extra)
135 return True, tips, self.modules_dict[module_name]
136
--> 137 search_result = hub.HubServer().get_module_url(
138 module_name, version=module_version, extra=extra)
139 name = search_result.get('name', None)

d:\ProgramData\Anaconda3\lib\site-packages\paddlehub\common\decorator_utils.py in synced_func(*args, **kwargs)
22 def synced_func(*args, **kwargs):
23 with func.__lock__:
---> 24 return func(*args, **kwargs)
25
26 return synced_func

d:\ProgramData\Anaconda3\lib\site-packages\paddlehub\common\decorator_utils.py in _get_instance(*args, **kwargs)
33 def _get_instance(*args, **kwargs):
34 if cls not in _instance:
---> 35 _instance[cls] = cls(*args, **kwargs)
36 return _instance[cls]
37

d:\ProgramData\Anaconda3\lib\site-packages\paddlehub\common\hub_server.py in __init__(self, config_file_path)
54
55 with open(config_file_path, "r") as fp:
---> 56 self.config = json.load(fp)
57
58 fp_lock = open(config_file_path)

d:\ProgramData\Anaconda3\lib\json\__init__.py in load(fp, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, **kw)
294 cls=cls, object_hook=object_hook,
295 parse_float=parse_float, parse_int=parse_int,
--> 296 parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)
297
298

d:\ProgramData\Anaconda3\lib\json\__init__.py in loads(s, encoding, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, **kw)
346 parse_int is None and parse_float is None and
347 parse_constant is None and object_pairs_hook is None and not kw):
--> 348 return _default_decoder.decode(s)
349 if cls is None:
350 cls = JSONDecoder

d:\ProgramData\Anaconda3\lib\json\decoder.py in decode(self, s, _w)
335
336 """
--> 337 obj, end = self.raw_decode(s, idx=_w(s, 0).end())
338 end = _w(s, end).end()
339 if end != len(s):

d:\ProgramData\Anaconda3\lib\json\decoder.py in raw_decode(self, s, idx)
353 obj, end = self.scan_once(s, idx)
354 except StopIteration as err:
--> 355 raise JSONDecodeError("Expecting value", s, err.value) from None
356 return obj, end

JSONDecodeError: Expecting value: line 1 column 1 (char 0)

收藏
点赞
0
个赞
共3条回复 最后由鹿鼎记肯定回复于2020-04-27 12:10
#4鹿鼎记肯定回复于2020-04-27 12:10:12

大概率是路径问题,参考一下这个:https://github.com/PaddlePaddle/PaddleHub/issues/541?tdsourcetag=s_pctim_aiomsg

0
#3xiaohongyd回复于2020-04-27 02:22:19

貌似环境没装好吧。Python,conda,paddlepaddle,paddlehub 都检查下。paddle.fluid.install_check.run_check() ,paddlehub.server_check() 都执行下,看看是否successfully。

0
#2鹿鼎记肯定回复于2020-04-26 14:58:59

看一下变量config_file_path里面是否有脏数据,一般是encode的参数不符合json格式报的错。

检查一下键值对是不是双引号,貌似这个有要求的

0
TOP
切换版块