Я использую трекер M DNet в TensorFlow, но не могу восстановить сохраненный файл параметров в формате .npy
# restore from model
restore_path = np.load(r"/home/ammar/Bureau/BSB/objectDetector/MDNet/TensorFlow/Tensorflow-
MDNet2/PyMDNet/models/init.npy", encoding='latin1', allow_pickle=True)
print(restore_path.shape)
saver.restore(sess, restore_path)
# run mdnet
mdnet_run(sess, model, train_data.data[seq].gts[0], train_data.data[seq].frames, config, display)
def get_params():
parser = argparse.ArgumentParser()
parser.add_argument('--no_display', action='store_true', help='disable display')
parser.add_argument('--dataset', choices=['otb', 'vot2013', 'vot2014', 'vot2015'],
help='choose pretrained dataset: [otb/vot2013/vot2014/vot2015]')
parser.add_argument('--seq', default=None, help='specify the sequence name')
# parser.add_argument('--load_path', default=None, help='initial model path')
return parser.parse_args()
if __name__ == '__main__':
params = get_params()
tracking(params.dataset, params.seq, display=(not params.no_display))
Однако получаю следующее сообщение об ошибке:
raise TypeError('Expected binary or unicode string, got %r' % bytes_or_text)
TypeError: Expected binary or unicode string, got array({'conv3': {'weights': array([[[[ 2.96924962e-03, 2.44032149e-03, 1.87524706e-02, ...,
-3.04966420e-02, -5.27264178e-03, 3.25399600e-02],
[-1.77949797e-02, -7.61169894e-03, -1.32844448e-02, ...,
-3.49473879e-02, -5.23791881e-03, 1.42552983e-02],
[ 1.34637039e-02, 1.24850320e-02, -6.11029379e-03, ...,
-3.11506377e-03, -3.70951928e-03, -8.27707537e-03],
...,
[-1.28862858e-02, 4.25704429e-03, -6.21365733e-04, ...,
-4.18921746e-03, -1.25541408e-02, -2.11683582e-04],
[-2.00554021e-02, 2.81158340e-04, -1.73938908e-02, ...,
-2.10881438e-02, -2.19026189e-02, 1.16309412e-02],
[ 3.12859491e-02, -1.00721987e-02, -6.25092722e-03, ...,
1.50483642e-02, 6.26835786e-03, 8.02897755e-03]],
[[-5.95682673e-03, -4.17428417e-03, 4.71407585e-02, ...,
-2.06687730e-02, 1.57501902e-02, 3.20734978e-02],
[-2.33041272e-02, -1.06462231e-02, 1.23480000e-02, ...,
-4.16394845e-02, 1.47569086e-02, 9.44598950e-03],
[-1.59230680e-04, -7.92068243e-03, -1.16510140e-02, ...,
-3.46589787e-03, -9.08019859e-03, -7.64780259e-03],
...,
[-2.09217593e-02, 7.27809500e-03, 3.70373891e-04, ...,
-1.44910607e-02, -1.79729778e-02, 1.02947410e-02],
[-6.12276373e-03, -3.08797061e-02, -4.86481615e-04, ...,
-1.71371922e-02, -1.97993498e-02, 2.52353232e-02],
[ 4.25643697e-02, -2.75588222e-02, -1.07662259e-02, ...,
8.58149200e-04, 2.15312615e-02, 1.31587777e-03]],
[[-2.43497617e-03, -4.38911980e-03, 3.14810388e-02, ...,
2.20061596e-02, 7.96327731e-05, 1.27312001e-02],
[ 1.21258637e-02, -1.26916971e-02, 2.11807042e-02, ...,
-4.29505520e-02, 1.75684947e-03, 1.83564741e-02],
[ 1.36933976e-03, 1.85998692e-03, -1.44176157e-02, ...,
-3.62297171e-03, -7.40917912e-03, -8.14919174e-03],
...,
[-9.89194959e-03, 3.61334393e-03, -6.45777956e-03, ...,
1.43555412e-02, -9.00308043e-03, 7.65976496e-03],
[ 1.13107366e-02, -2.85065603e-02, 1.53690604e-02, ...,
-1.88868977e-02, -4.34042886e-03, 1.19012501e-02],
[ 2.56330874e-02, -6.70781219e-03, 2.99922336e-04, ...,
-8.63060262e-03, 8.37695505e-03, -4.59404755e-03]]],
[[[-3.16732600e-02, -1.17864460e-02, -1.77307893e-02, ...,
-2.76390556e-02, 3.76368011e-03, -6.24960195e-03],
[-7.98435323e-03, -2.48401100e-03, -1.93730630e-02, ...,
-2.54958626e-02, 5.63128153e-03, 1.27101522e-02],
[ 8.47530365e-03, 3.25949490e-03, -1.33863147e-02, ...,
-2.21773493e-03, -1.36776567e-02, -1.15536693e-02],
...,
[ 2.40535871e-03, -1.70901064e-02, 3.48119927e-03, ...,
-1.59064867e-02, -1.26330992e-02, 1.14208525e-02],
[ 1.42963650e-02, 3.27137896e-05, 2.67479662e-03, ...,
1.89576845e-03, 1.75798210e-04, 1.58170406e-02],
[ 1.31099680e-02, -7.93774985e-03, -5.32964151e-03, ...,
5.16986195e-03, 1.53387450e-02, -5.06003201e-03]],
[[-2.57510431e-02, -6.07340736e-03, -2.44006258e-03, ...,
5.45105478e-03, 3.89888920e-02, -3.14044729e-02],
[-2.52325181e-02, 1.03622279e-03, -1.38781378e-02, ...,
-3.17982323e-02, 1.84350498e-02, 4.60231863e-03],
[-7.26138754e-03, -5.48406597e-03, -1.68195162e-02, ...,
1.51331339e-03, -2.76589245e-02, -1.53501863e-02],
...,
[-2.57449667e-03, -1.26364138e-02, -3.78296291e-03, ...,
-1.67726167e-02, -1.95934437e-02, 2.09262613e-02],
[-1.63010659e-03, -1.40982009e-02, -8.82423669e-03, ...,
1.36346901e-02, 1.31164154e-03, 6.82593044e-03],
[ 1.71241667e-02, -1.09897240e-03, -7.70571548e-03, ...,
-1.21090002e-02, 4.71026413e-02, -1.14638936e-02]],
[[ 3.51524502e-02, 1.29259471e-02, -6.42549654e-04, ...,
4.68948074e-02, 1.25510432e-02, -1.96594875e-02],
[ 1.36037488e-02, -1.25788441e-02, 2.55835503e-02, ...,
-1.99776310e-02, 2.65715714e-03, -8.87955073e-04],
[-1.01653556e-03, 3.90071631e-03, -1.64727475e-02, ...,
-3.88033804e-03, -2.28793789e-02, -9.44840070e-03],
...,
[-2.03540139e-02, -1.32849687e-04, -1.04390439e-02, ...,
1.95043571e-02, -7.20420759e-03, 4.68092039e-03],
[-2.00077891e-02, -2.40283627e-02, -1.39591284e-02, ...,
1.31490855e-02, 7.16553023e-03, -3.88590299e-04],
[ 1.23484638e-02, 8.44733510e-03, 4.24845144e-04, ...,
-1.02086868e-02, 2.27275584e-02, -1.02215251e-02]]],
[[[-4.11387533e-02, 2.43678712e-03, -2.09585223e-02, ...,
7.56536098e-03, -3.83367320e-03, -1.14008272e-02],
[-2.57478654e-02, 6.14082348e-03, -3.46454140e-03, ...,
-5.80876693e-03, 7.86745083e-03, -3.66140087e-03],
[-9.95932892e-03, 2.28082389e-03, -1.46572813e-02, ...,
1.94595568e-03, -8.16610828e-03, -3.99934768e-04],
...,
[ 1.82403624e-02, -1.94653403e-02, 2.11584195e-03, ...,
-7.30354432e-03, -3.19446600e-03, -1.03775589e-02],
[ 4.26710583e-04, 2.00044108e-03, 1.06584700e-02, ...,
-4.64997051e-04, -5.00477909e-04, 5.85416332e-03],
[-2.12159324e-02, -3.64470039e-03, -2.37104343e-03, ...,
-6.39280130e-04, 5.65811712e-03, 2.08736653e-03]],
[[-3.71798351e-02, 7.96074327e-03, 5.71678067e-03, ...,
1.37950536e-02, 3.56519446e-02, -2.42006015e-02],
[-1.62976775e-02, 1.31418593e-02, -1.09790750e-02, ...,
-1.12456148e-02, 1.15870796e-02, -3.93791962e-03],
[-1.79590061e-02, 8.21866933e-03, -1.50049319e-02, ...,
4.82946215e-03, -2.88111232e-02, 1.94794650e-03],
...,
[ 2.47141477e-02, -9.15935263e-03, -4.31132223e-03, ...,
-7.66610121e-03, -7.70677393e-03, -6.27333159e-03],
[ 4.93465271e-03, 2.56183296e-02, 7.03870598e-03, ...,
2.73467769e-04, 1.10505549e-02, -9.78140254e-03],
[-3.00048143e-02, 1.14612025e-03, -3.97338765e-03, ...,
-1.04845436e-02, 2.32075918e-02, 3.25265806e-04]],
[[ 4.77581099e-02, 2.06978619e-02, -7.39846891e-03, ...,
2.96884198e-02, 1.71455145e-02, -6.87868427e-03],
[-9.37315170e-04, -9.64690465e-04, 1.47960167e-02, ...,
9.43796767e-05, 5.86313708e-03, -4.74523148e-03],
[ 8.00791197e-04, 1.74116809e-02, -1.13096917e-02, ...,
-7.91961909e-04, -2.02328283e-02, 6.67807739e-03],
...,
[-4.58469335e-03, 1.24704633e-02, -8.32158979e-03, ...,
4.36383346e-03, -6.09497307e-03, -9.02637839e-03],
[ 1.37679111e-02, 8.84075928e-03, -9.17388126e-03, ...,
6.76884502e-03, 5.72908949e-03, 6.63520908e-03],
[-1.22973940e-03, -2.53778649e-03, -1.66776299e-03, ...,
-2.43400084e-03, 2.96169939e-03, 4.01783315e-03]]]],
dtype=float32), 'biases': array([-7.15379268e-02, -1.41905054e-01, 4.97806072e-02, 1.95055246e-01,
Я использую Python version = 3.6, TensorFlow = 1.10 и Numpy = 1.18: невозможно ли загрузить файлы .npy в python 3 или есть проблема с загрузкой файла?