tensorboard
tensorboard copied to clipboard
Fix azure logging
Motivation for features / changes
When using the TensorboardLogger in Pytorch lightning to log to an Azure blob storage location, the following error is thrown:
ErrorCode:InvalidBlobType
Content: <?xml version="1.0" encoding="utf-8"?><Error><Code>InvalidBlobType</Code><Message>The blob type is invalid for this operation.
This is due to the assumption that if the filesystem supports append opperations, these will automatically be available for any file in the blob storage, see this code snippet from gfile.py:
if self.fs_supports_append:
if not self.write_started:
# write the first chunk to truncate file if it already exists
self.fs.write(self.filename, file_content, self.binary_mode)
self.write_started = True
else:
# append the later chunks
self.fs.append(self.filename, file_content, self.binary_mode)
However, in Azure, if a file is created by opening it in write mode, it will not permit append operations later on.