Browse Source

!1815 fix mindrecord seekg failed

Merge pull request !1815 from guozhijian/fix_mindrecord_seekg_failed
tags/v0.5.0-beta
mindspore-ci-bot Gitee 5 years ago
parent
commit
6e1dfe5fc6
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      mindspore/ccsrc/mindrecord/io/shard_writer.cc

+ 1
- 1
mindspore/ccsrc/mindrecord/io/shard_writer.cc View File

@@ -90,7 +90,7 @@ MSRStatus ShardWriter::OpenDataFiles(bool append) {
fs->close();

// open the mindrecord file to write
fs->open(common::SafeCStr(file), std::ios::out | std::ios::binary);
fs->open(common::SafeCStr(file), std::ios::out | std::ios::in | std::ios::binary | std::ios::trunc);
if (!fs->good()) {
MS_LOG(ERROR) << "MindRecord file could not opened.";
return FAILED;


Loading…
Cancel
Save