File size: 533 Bytes
5abbc08
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import json
import os

# 创建完整的索引
index_dict = {
    "train": list(range( 50000)),  #50000的训练索引
    "test": list(range(50000, 60000)),  # 测试索引
    "validation": []  # 空验证集
}

# 保存到索引文件
index_path = os.path.join('..', 'dataset', 'index.json')
with open(index_path, 'w') as f:
    json.dump(index_dict, f, indent=4)

print(f"已创建完整索引文件: {index_path}")
print(f"训练集: {len(index_dict['train'])}个样本")
print(f"测试集: {len(index_dict['test'])}个样本")