我在 Kaggle 上使用 FastAi 构建了一个文本分类器,在尝试导出经过训练的模型时出现以下错误 - TypeError: unsupported operand type(s) for /: 'str' and 'str'
我尝试设置更精简的模型目录和工作目录的路径。
learn_clas.path='/kaggle/working/'
learn_clas.model_dir='/kaggle/working/'
learn_clas.export()
我得到的错误是 -
/opt/conda/lib/python3.6/site-packages/fastai/torch_core.py in try_save(state, path, file)
410 def try_save(state:Dict, path:Path=None, file:PathLikeOrBinaryStream=None):
--> 411 target = open(path/file, 'wb') if is_pathlike(file) else file
412 try: torch.save(state, target)
413 except OSError as e:
TypeError: unsupported operand type(s) for /: 'str' and 'str'