python深度学习问题
因学习以及作业,现复现一个CVPR2017的一个手势识别图像处理项目下载源代码以及数据集后运行训练代码,始终报错
我感觉路径是弄对了的
from __future__ import print_function, unicode_literals
import tensorflow as tf
import os
import sys
from nets.ColorHandPose3DNetwork import ColorHandPose3DNetwork
from data.BinaryDbReader import BinaryDbReader
from utils.general import LearningRateScheduler, load_weights_from_snapshot
# training parameters
train_para = {'lr': ,
'lr_iter': ,
'max_iter': 40000,
'show_loss_freq': 1000,
'snapshot_freq': 5000,
'snapshot_dir': 'snapshots_handsegnet'}
# get dataset
dataset = BinaryDbReader(mode='training',
batch_size=8, shuffle=True,
hue_aug=True, random_crop_to_size=True)
# build network graph
data = dataset.get()
self.path_to_db = './date/bin/'
self.num_samples = 0
if mode == 'training':
self.path_to_db += 'rhd_training.bin'
self.num_samples = 41258
elif mode == 'evaluation':
self.path_to_db += 'rhd_evaluation.bin'
self.num_samples = 2728
else:
assert 0, "Unknown dataset mode."
assert os.path.exists(self.path_to_db), "Could not find the binary data file!"
error:Traceback (most recent call last):
File "hand3d-master/training_handsegnet.py", line 25, in <module>
hue_aug=True, random_crop_to_size=True)
File "hand3d-master\data\BinaryDbReader.py", line 53, in __init__
assert os.path.exists(self.path_to_db), "Could not find the binary data file!"
AssertionError: Could not find the binary data file!
有没有试过绝对路径呢? yuxijian2020 发表于 2021-4-15 10:18
有没有试过绝对路径呢?
刚才试了一下绝对路径,也不行 还是报错 但是这个BinaryDbReader 的py程序单独运行是没有问题的,也没有输出,主要是数据集的二进制文件的获取,但是从别的训练程序获取这个程序来训练就会发生Assert的报错 路径是反斜杠吧... \\
斜杠是 // 没看懂哎 我没看懂 (r'./date/bin/')这样试试看,你这个是没找到数据集的问题啊,参数传不进去
页:
[1]