python - 当我使用 MITSceneParsing 数据实现 FCN 时,出现此错误 [TypeError: 'NoneType' object is not subscriptable]
问题描述
我在实现全卷积网络时使用了 MITSceneParsing 数据。但是我收到了这个错误 [TypeError: 'NoneType' object is not subscriptable]。所以有人知道这个原因吗?
import pickle
def read_dataset(data_dir):
pickle_filename = "MITSceneParsing.pickle"
pickle_filepath = os.path.join(data_dir, pickle_filename)
if not os.path.exists(pickle_filepath):
utils.maybe_download_and_extract(data_dir, DATA_URL, is_zipfile=True)
SceneParsing_folder = os.path.splitext(DATA_URL.split("\\")[-1])[0]
result = create_image_lists(os.path.join(data_dir, SceneParsing_folder))
print("Pickling...")
with open(pickle_filepath, 'wb') as f:
pickle.dump(result, f, pickle.HIGHEST_PROTOCOL)
else:
print("Found pickle file!")
with open(pickle_filepath, 'rb') as f:
result = pickle.load(f)
training_records = result['training']
validation_records = result['validation']
del result
return training_records, validation_records
解决方案
推荐阅读
- javascript - 将操作从 localhost 上托管的 Javascript/PHP 发送到 WPF 应用程序
- python - 将集合的 defaultdict 替换为具有 setdefault 的普通 dict
- android - 如何在 Kotlin (Anko) 中解析 JSON?
- c# - C# IIS Web 应用程序的缓存存储库服务
- go - 如何将整个日志发送到 jaeger span
- python - 尝试使用 MSI 身份验证从 Azure ML 服务连接 Azure SQL 数据库(没有用户名和密码连接 Azure 数据库)
- node.js - https npm 模块已安装,但 node_modules 目录中没有显示文件
- android - 如何监控应用程序的退出?
- c - 警告 - 赋值使指针从整数而不进行强制转换
- python - 如何为使用 django、docker 和 mysql 的项目设置最佳配置?