DeprecationWarning: tostring() is deprecated
See original GitHub issueHello,
The method joblib.numpy_pickle.NumpyArrayWrapper.write_array
is using chunk.tostring
, which is deprecated and should be replaced by chunk.tobytes
:
File "_my_scrambled_path_/python3.7/site-packages/joblib/numpy_pickle.py", line 103, in write_array
pickler.file_handle.write(chunk.tostring('C'))
DeprecationWarning: tostring() is deprecated. Use tobytes() instead.
Versions: python 3.7.4, joblib 0.15.1, numpy 1.19.0
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
DeprecationWarning: tostring() is deprecated. Use tobytes ...
tostring() apparently is deprecated since version 3.2, I guess that the warning pops up now because the method will be removed in version...
Read more >tensorflow 1.15 raises DeprecationWarning: tostring ... - GitLab
tensorflow (v1.15) raises the following warning when numpy v1.19 or later is used: DeprecationWarning: tostring() is deprecated.
Read more >python - What is the difference between tostring() and tobytes ...
tostring has been kept for backwards compatibility, but the use of tostring is deprecated. Share.
Read more >LimaCCDs: Deprecation warning to replace `tostring` (#47) · Issues ...
While i was playing with the simulator i have received that stuff. No idea why it's the first time i notice that stuff....
Read more >Meme Overflow on Twitter: "This error comes up ...
This error comes up, DeprecationWarning: tostring() is deprecated. Use tobytes() instead. which is effecting video playback ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Actually,
master
is not usingtostring
anymore since #1056 . As we are moving away from old python version (numpy1.6
was released 9years ago), I would say it is okay to only supportnumpy1.9+
(2014) but it should indeed be fixed in the doc.ndarray.tostring
is deprecated since numpy 1.19 according to this https://numpy.org/devdocs/reference/generated/numpy.ndarray.tostring.html.ndarray.tobytes
was added in numpy 1.9: https://numpy.org/devdocs/reference/generated/numpy.ndarray.tobytes.html#numpy.ndarray.tobytesThe README says joblib supports numpy 1.6.1 (not sure if completely up-to-date).
Hmmm I guess in order to avoid the warning we could create a shim function i.e. something like this:
And then use our
tobytes
function.Since numpy moves quite slowly the
tostring
method is not going to be removed for some time, so doing nothing may be an option … until our minimum numpy version goes to numpy 1.9.scikit-learn requires numpy >= 1.13.3 so maybe bumping up the minimal numpy version may be another option.