Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/323.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python os.mknod返回google colab中未实现的[error38]函数_Python_Pytorch_Google Colaboratory_Mknod - Fatal编程技术网

Python os.mknod返回google colab中未实现的[error38]函数

Python os.mknod返回google colab中未实现的[error38]函数,python,pytorch,google-colaboratory,mknod,Python,Pytorch,Google Colaboratory,Mknod,我试图在GoogleColab上运行以下代码 dir_path = '/content/drive/My Drive/Colab Notebooks' log_loss_path =os.path.join(dir_path, 'log_loss.txt') if not os.path.isfile(log_loss_path): os.mknod(log_loss_path) 但是我得到的错误[Errno 38]函数没有实现 OSError

我试图在GoogleColab上运行以下代码

dir_path = '/content/drive/My Drive/Colab Notebooks'
log_loss_path =os.path.join(dir_path, 'log_loss.txt')
if not os.path.isfile(log_loss_path):
    os.mknod(log_loss_path)
但是我得到的错误[Errno 38]函数没有实现

    OSError                                   Traceback (most recent call last)
<ipython-input-15-bd3880e6bb8b> in <module>()
      2 log_loss_path = os.path.join(dir_path, 'log_loss.txt')
      3 if not os.path.isfile(log_loss_path):
----> 4     os.mknod(log_loss_path)

OSError: [Errno 38] Function not implemented
OSError回溯(最近一次调用)
在()
2 log\u loss\u path=os.path.join(dir\u path,'log\u loss.txt')
3如果不是os.path.isfile(日志丢失路径):
---->4 os.mknod(日志丢失路径)
OSError:[Errno 38]函数未实现

有人能帮忙解决吗?

/content/drive
是一个不支持此操作的FUSE文件系统

如果您只是试图创建一个文件,请改用
open(log\u loss\u path,'w')