tar数据集文件作为使用此代码的卷积神经网络的输入 如何将提取的tarfile用作网络模型的输入,如x_test,y_test x_train,y_train?
import tarfile
import os
from keras.applications import vgg16
import numpy as np
import matplotlib.pyplot as plt
import matplotlib
#data
os.chdir ("C:/Users/hp/Downloads")
os.listdir()
tar=tarfile.open('VOC2012test.tar')
test=tar.extractall()
for tarinfo in tar:
print(tarinfo.name, "is", tarinfo.size, "bytes in size and is", end="")
if tarinfo.isreg():
print("a regular file.")
elif tarinfo.isdir():
print("a directory.")
else:
print("something else.")
tar2=tarfile.open('VOCtrainval_11-May-2012.tar')
train=tar2.extractall()
for tarinfo in tar2:
print(tarinfo.name, "is", tarinfo.size, "bytes in size and is", end="")
# The data, shuffled and split between train and test sets:
(X_train, y_train)=train
(X_test, y_test) = test
我收到此错误
File "<ipython-input-54-49cf9d1e879a>", line 1, in <module>
(X_test, y_test) = test
TypeError: 'NoneType' object is not iterable