You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's a pleasure working with Neptune, thanks.
I am trying to log a StringIO as an artifact. I wish to avoid saving a temporary file in-order to log it and then proceed to remove it.
Neptune version: 0.4.126
It was installed using Conda on Ubuntu 18.04.
Python version 3.7.8
The error I'm getting is (I omitted some of my paths):
Traceback (most recent call last):
File "", line 12, in
neptune.send_artifact(summary_string_io, destination="summary.txt")
File "lib/python3.7/site-packages/neptune/init.py", line 355, in send_artifact
return get_experiment().log_artifact(artifact, destination)
File "lib/python3.7/site-packages/neptune/experiments.py", line 620, in log_artifact
experiment=self)
File "lib/python3.7/site-packages/neptune/internal/storage/storage_utils.py", line 230, in upload_to_storage
upload_api_fun(**dict(kwargs, data=file_chunk_stream, progress_indicator=progress_indicator))
File "lib/python3.7/site-packages/neptune/internal/backends/hosted_neptune_backend.py", line 692, in upload_experiment_output
query_params={})
File "lib/python3.7/site-packages/neptune/internal/backends/hosted_neptune_backend.py", line 847, in _upload_loop
ret = with_api_exceptions_handler(self._upload_loop_chunk)(fun, part, data, **kwargs)
File "lib/python3.7/site-packages/neptune/utils.py", line 211, in wrapper
return func(*args, **kwargs)
File "lib/python3.7/site-packages/neptune/internal/backends/hosted_neptune_backend.py", line 865, in _upload_loop_chunk
response = fun(data=part.get_data(), headers=headers, **kwargs)
File "lib/python3.7/site-packages/neptune/internal/storage/datastream.py", line 34, in get_data
return io.BytesIO(self.data)
TypeError: a bytes-like object is required, not 'str'
I tried looking for examples but I couldn't find any.
Thank you,
Ben.
The text was updated successfully, but these errors were encountered:
I've been checking your issue and found out that despite the fact that you provided some content to the StringIO, Neptune could read only empty content. Traceback is related to the issue of wrong handling empty StringIO and we've just publish a fix release 0.4.127. It should be available to download very soon.
More interesting for you will be fixing the stream, so Neptune will be able to read it's content. In this fix I also updated the docs for log_artifact method(). According to the docs, when you write to some stream like StringIO, it's position is set to the end of the steam. When you now call read() on this stream, you won't get any content. You need to rewind the stream to the beginning (by calling seek(0) for example), so anyone (and Neptune) can read it.
Hope it will resolve your issue. Good luck with Neptune.
Hello,
It's a pleasure working with Neptune, thanks.
I am trying to log a StringIO as an artifact. I wish to avoid saving a temporary file in-order to log it and then proceed to remove it.
Neptune version: 0.4.126
It was installed using Conda on Ubuntu 18.04.
Python version 3.7.8
Here is a minimal example to reproduce:
The error I'm getting is (I omitted some of my paths):
I tried looking for examples but I couldn't find any.
Thank you,
Ben.
The text was updated successfully, but these errors were encountered: