多进程对同一内容编译时,导致编译文件锁住了,清空缓存文件即可
if version != old_version:
print('build_directory lock:',build_directory) # 打印缓存文件位置
baton = FileBaton(os.path.join(build_directory, 'lock'))
if baton.try_acquire():
try:
Windows
缓存目录- 删除
Cache
目录即可
C:\Users\win 10\AppData\Local\torch_extensions\torch_extensions\Cache
Linux
rm -rf /home/account_name/.cache/torch_extensions/*
网友评论