Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/362.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/python-3.x/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 当我使用MITSceneParsing数据实现FCNs时,我遇到了以下错误[TypeError:';NoneType';对象不可下标]_Python_Python 3.x_Python 2.7_Tensorflow_Pickle - Fatal编程技术网

Python 当我使用MITSceneParsing数据实现FCNs时,我遇到了以下错误[TypeError:';NoneType';对象不可下标]

Python 当我使用MITSceneParsing数据实现FCNs时,我遇到了以下错误[TypeError:';NoneType';对象不可下标],python,python-3.x,python-2.7,tensorflow,pickle,Python,Python 3.x,Python 2.7,Tensorflow,Pickle,我在实现完全卷积网络时使用了MITSceneParsing数据。但我得到了这个错误[TypeError:'NoneType'对象不可下标]。有人知道这个原因吗 import pickle def read_dataset(data_dir): pickle_filename = "MITSceneParsing.pickle" pickle_filepath = os.path.join(data_dir, pickle_filename) if not os.path

我在实现完全卷积网络时使用了MITSceneParsing数据。但我得到了这个错误[TypeError:'NoneType'对象不可下标]。有人知道这个原因吗

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

请显示堆栈跟踪的相关部分。请显示堆栈跟踪的相关部分。