CAN icon indicating copy to clipboard operation
CAN copied to clipboard

复现时遇到的问题

Open ywjhs opened this issue 9 months ago • 2 comments

训练可以正常进行,但是不知道训练中途保存的参数会保存在哪里,同时发现inference.py需要的标签checkpoint的内容是空的,请问配置文件里的checkpoint应该怎么填,什么时候填,以及训练时的参数会保存在哪里

ywjhs avatar May 07 '24 02:05 ywjhs

你好,请问问题解决了吗,我尝试在jupyter中训练checkpoints文件夹打不开,但是使用colab训练checkpoints文件可以正常打开,并且模型会正常保存

Quiyyy avatar May 24 '24 03:05 Quiyyy

问题解决了,模型其实已经保存了,只是文件太大打不开,你可以使用这段代码将checkpoints文件夹压缩 `import shutil import os

def compress_folder(folder_name, output_path): """ Compresses the specified folder into a zip file.

Parameters:
folder_name (str): The name of the folder to compress.
output_path (str): The path of the output zip file.
"""
folder_path = os.path.abspath(folder_name)
if not os.path.exists(folder_path):
    print(f'Folder "{folder_path}" does not exist.')
    return

shutil.make_archive(output_path, 'zip', folder_path)
print(f'Folder "{folder_path}" has been compressed into "{output_path}.zip"')

示例用法,将当前工作目录下的 "checkpoints" 文件夹压缩为 "checkpoints.zip"

compress_folder('checkpoints', 'checkpoints')`

Quiyyy avatar May 24 '24 04:05 Quiyyy