advisor
advisor copied to clipboard
[ Bug? ] JSONDecodeError is raised when running the examples
System Information
OS: Ubuntu 18.04.1 running in an LXD container LXD: 3.6 (snap) conda: 4.5.11 Python: 3.7.0.final.0 advisor: 0.1.6 requests: 2.19.1
Issue
I am having trouble running the examples in the repo. Executing the following commands:
git clone --depth 1 https://github.com/tobegit3hub/advisor.git && cd ./advisor/
advisor run -f ./advisor_client/examples/python_function/config.json
raises a json.decoder.JSONDecodeError:
2018-10-23 01:27:13 INFO Run with config: {'name': 'demo', 'algorithm': 'BayesianOptimization', 'trialNumber': 10, 'path': './advisor_client/examples/python_function/', 'command': './min_function.py', 'search_space': {'goal': 'MINIMIZE', 'randomInitTrials': 3, 'params': [{'parameterName': 'x', 'type': 'DOUBLE', 'minValue': -10.0, 'maxValue': 10.0}]}}
Traceback (most recent call last):
File "/home/ubuntu/.conda/envs/ubuntu/bin/advisor", line 11, in <module>
sys.exit(main())
File "/home/ubuntu/.conda/envs/ubuntu/lib/python3.7/site-packages/advisor_client/commandline/command.py", line 194, in main
args.func(args)
File "/home/ubuntu/.conda/envs/ubuntu/lib/python3.7/site-packages/advisor_client/commandline/command.py", line 131, in run_with_file
launcher.run()
File "/home/ubuntu/.conda/envs/ubuntu/lib/python3.7/site-packages/advisor_client/runner/runner_launcher.py", line 56, in run
self.run_config_dict["algorithm"])
File "/home/ubuntu/.conda/envs/ubuntu/lib/python3.7/site-packages/advisor_client/client.py", line 47, in get_or_create_study
study_exist = response.json()["exist"]
File "/home/ubuntu/.conda/envs/ubuntu/lib/python3.7/site-packages/requests/models.py", line 896, in json
return complexjson.loads(self.text, **kwargs)
File "/home/ubuntu/.conda/envs/ubuntu/lib/python3.7/json/__init__.py", line 348, in loads
return _default_decoder.decode(s)
File "/home/ubuntu/.conda/envs/ubuntu/lib/python3.7/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/home/ubuntu/.conda/envs/ubuntu/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 2 column 1 (char 1)
This error is not particular to the python_function example. Attempting to run the tensorflow_mnist example via advisor run -f ./advisor_client/examples/tensorflow_mnist/config.json raises the same error:
2018-10-23 01:29:18 INFO Run with config: {'name': 'simple1', 'algorithm': 'RandomSearch', 'trialNumber': 3, 'concurrency': 1, 'path': '~/code/advisor/advisor_client/examples/tensorflow_mnist/', 'command': './tensorflow_mnist.py', 'search_space': {'goal': 'MINIMIZE', 'randomInitTrials': 1, 'maxTrials': 5, 'maxParallelTrials': 1, 'params': [{'parameterName': 'batch_size', 'type': 'DISCRETE', 'minValue': 0, 'maxValue': 0, 'feasiblePoints': '16, 32, 64, 128, 256', 'scalingType': 'LINEAR'}, {'parameterName': 'batch_number', 'type': 'INTEGER', 'minValue': 500, 'maxValue': 3000, 'feasiblePoints': '', 'scalingType': 'LINEAR'}, {'parameterName': 'optimizer', 'type': 'CATEGORICAL', 'minValue': 0, 'maxValue': 0, 'feasiblePoints': 'sgd, adagrad, adam, ftrl', 'scalingType': 'LINEAR'}, {'parameterName': 'learning_rate', 'type': 'DOUBLE', 'minValue': 0.01, 'maxValue': 0.1, 'feasiblePoints': '', 'scalingType': 'LINEAR'}]}}
Traceback (most recent call last):
File "/home/ubuntu/.conda/envs/ubuntu/bin/advisor", line 11, in <module>
sys.exit(main())
File "/home/ubuntu/.conda/envs/ubuntu/lib/python3.7/site-packages/advisor_client/commandline/command.py", line 194, in main
args.func(args)
File "/home/ubuntu/.conda/envs/ubuntu/lib/python3.7/site-packages/advisor_client/commandline/command.py", line 131, in run_with_file
launcher.run()
File "/home/ubuntu/.conda/envs/ubuntu/lib/python3.7/site-packages/advisor_client/runner/runner_launcher.py", line 56, in run
self.run_config_dict["algorithm"])
File "/home/ubuntu/.conda/envs/ubuntu/lib/python3.7/site-packages/advisor_client/client.py", line 47, in get_or_create_study
study_exist = response.json()["exist"]
File "/home/ubuntu/.conda/envs/ubuntu/lib/python3.7/site-packages/requests/models.py", line 896, in json
return complexjson.loads(self.text, **kwargs)
File "/home/ubuntu/.conda/envs/ubuntu/lib/python3.7/json/__init__.py", line 348, in loads
return _default_decoder.decode(s)
File "/home/ubuntu/.conda/envs/ubuntu/lib/python3.7/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/home/ubuntu/.conda/envs/ubuntu/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 2 column 1 (char 1)
Perhaps there's an error on my part? I'm afraid I'm quite new to advisor.
Thanks @mlaradji for reporting. It may be the issue of Python 3 and I will test in another environment for this soon.
Had the same issue. Looking forwarding to your feedback! Thanks.
my system is ubuntu 16.04, conda , python3.6. Had the same issue
python 2.7
same issue