Repository navigation
Closed
Description
Description
I cannot reproduce the MNIST classfification using multinomial logistic + L1 example.
Steps/Code to Reproduce
I copied the whole code, as is, into a Jupyter Notebook.
Expected Results
No errors and similar results to the example's web page.
Actual Results
Automatically created module for IPython interactive environment
---------------------------------------------------------------------------
JSONDecodeError Traceback (most recent call last)
<ipython-input-5-e53e77eeb3b2> in <module>
19
20 # Load data from https://www.openml.org/d/554
---> 21 X, y = fetch_openml('mnist_784', version=1, return_X_y=True)
22
23 random_state = check_random_state(0)
/opt/tljh/user/lib/python3.6/site-packages/sklearn/datasets/openml.py in fetch_openml(name, version, data_id, data_home, target_column, cache, return_X_y)
478 "data_id.")
479
--> 480 data_description = _get_data_description_by_id(data_id, data_home)
481 if data_description['status'] != "active":
482 warn("Version {} of dataset {} is inactive, meaning that issues have "
/opt/tljh/user/lib/python3.6/site-packages/sklearn/datasets/openml.py in _get_data_description_by_id(data_id, data_home)
293 error_message = "Dataset with data_id {} not found.".format(data_id)
294 json_data = _get_json_content_from_openml_api(url, error_message, True,
--> 295 data_home)
296 return json_data['data_set_description']
297
/opt/tljh/user/lib/python3.6/site-packages/sklearn/datasets/openml.py in _get_json_content_from_openml_api(url, error_message, raise_if_error, data_home)
131 else:
132 return None
--> 133 json_data = json.loads(response.read().decode("utf-8"))
134 response.close()
135 return json_data
/opt/tljh/user/lib/python3.6/json/__init__.py in loads(s, encoding, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, **kw)
352 parse_int is None and parse_float is None and
353 parse_constant is None and object_pairs_hook is None and not kw):
--> 354 return _default_decoder.decode(s)
355 if cls is None:
356 cls = JSONDecoder
/opt/tljh/user/lib/python3.6/json/decoder.py in decode(self, s, _w)
337
338 """
--> 339 obj, end = self.raw_decode(s, idx=_w(s, 0).end())
340 end = _w(s, end).end()
341 if end != len(s):
/opt/tljh/user/lib/python3.6/json/decoder.py in raw_decode(self, s, idx)
355 obj, end = self.scan_once(s, idx)
356 except StopIteration as err:
--> 357 raise JSONDecodeError("Expecting value", s, err.value) from None
358 return obj, end
JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Versions
System
------
python: 3.6.5 |Anaconda, Inc.| (default, Apr 29 2018, 16:14:56) [GCC 7.2.0]
executable: /opt/tljh/user/bin/python
machine: Linux-4.15.0-38-generic-x86_64-with-debian-buster-sid
BLAS
----
macros:
lib_dirs:
cblas_libs: cblas
Python deps
-----------
pip: 10.0.1
setuptools: 39.1.0
sklearn: 0.20.0
numpy: 1.15.3
scipy: 1.1.0
Cython: None
pandas: None
as well as these warnings:
/opt/tljh/user/lib/python3.6/site-packages/numpy/distutils/system_info.py:625: UserWarning:
Atlas (http://math-atlas.sourceforge.net/) libraries not found.
Directories to search for the libraries can be specified in the
numpy/distutils/site.cfg file (section [atlas]) or by setting
the ATLAS environment variable.
self.calc_info()
/opt/tljh/user/lib/python3.6/site-packages/numpy/distutils/system_info.py:625: UserWarning:
Blas (http://www.netlib.org/blas/) libraries not found.
Directories to search for the libraries can be specified in the
numpy/distutils/site.cfg file (section [blas]) or by setting
the BLAS environment variable.
self.calc_info()
/opt/tljh/user/lib/python3.6/site-packages/numpy/distutils/system_info.py:625: UserWarning:
Blas (http://www.netlib.org/blas/) sources not found.
Directories to search for the sources can be specified in the
numpy/distutils/site.cfg file (section [blas_src]) or by setting
the BLAS_SRC environment variable.
self.calc_info()
Metadata
Metadata
Assignees
Labels
No labels
Activity
samwaterbury commentedon Nov 4, 2018
The important code is:
I was able to reproduce the error on the current release of scikit-learn but not on the most recent development version in this repo. I know some work was done recently on
fetch_openmlso I believe the issue has been resolved. However, if someone else could confirm that would be great.irrhuh commentedon Nov 5, 2018
Just encountered the same error.
Not sure how to resolve it too.
rth commentedon Nov 5, 2018
Thanks for the report, I can reproduce this with 0.20.0 and can confirm this is fixed on master.
The current workaround is either to use the latest development version or wait for the 0.20.1 release which should happen soon.
Bruno-Hanzen commentedon Nov 11, 2018
I have just experienced the same issue (2018/11/11), although:
-scikit-learn version is 0.20.0
-I have not updated any module since "quite a time" (certainly not last week).
Are there changes ongoing @ Openml?
thomasjpfan commentedon Nov 11, 2018
When calling
mnist = fetch_openml('mnist_784', cache=False)it will request https://openml.org/api/v1/json/data/554 for information. This call returns an HTML object and not a JSON object. This will lead to a JSONDecodeError as well.jnothman commentedon Nov 12, 2018
rth commentedon Nov 12, 2018
Reported upstream openml/OpenML#861
rth commentedon Nov 12, 2018
Thanks for investigating this @thomasjfox !
rth commentedon Nov 12, 2018
Though I think there may be two separate issues here,
joaquinvanschoren commentedon Nov 12, 2018
Sorry, this was caused by a bad configuration setting on the server. Fixed now.
rth commentedon Nov 12, 2018
Thanks for the quick response, can confirm it works on scikit-learn master now.
thomasjpfan commentedon Nov 12, 2018
@rth PR #12526 should be able to address other issue.
z-a-f commentedon Feb 22, 2019
Same error (with the same call) resurfaced. Version: 0.20.2
janvanrijn commentedon Feb 22, 2019
Seems to be the same issue as this
openml/OpenML#932
janvanrijn commentedon Feb 22, 2019
I applied a hotfix.
joaquinvanschoren commentedon Feb 22, 2019
Found the bug and fixed it.
Simondharcourt commentedon Jul 4, 2019
Awesome it works !!!