Open AirPlanBird opened 5 months ago
Please check if the data path is correct, I encountered the same problem and it has been solved.
请检查数据路径是否正确,我遇到了同样的问题,已经解决了。 你好,这里我有一点不理解,就是他这个bert文件夹下存放两个bert模型文件夹(中文和英文的),还是将bert当成模型文件夹,直接下载模型到该位置下?
请检查数据路径是否正确,我遇到了同样的问题,已经解决了。 你好,这里我有一点不理解,就是他这个bert文件夹下存放两个bert模型文件夹(中文和英文的),还是将bert当成模型文件夹,直接下载模型到该位置下?
bert是从hugging face下载的,一个文件夹包含很多的文件。两个文件夹,分别对应中文BERT和英文BERT。
Traceback (most recent call last): File "../train.py", line 204, in
training(model, args, train_loader, test_loader, writer)
File "../train.py", line 52, in training
for input_ids, attention_mask, token_type_ids, img_emb, label, path_tensor in train_loader:
File "/root/siton-data-wangruiData/conda/envs/cffn/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 631, in next
data = self._next_data()
File "/root/siton-data-wangruiData/conda/envs/cffn/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1346, in _next_data
return self._process_data(data)
File "/root/siton-data-wangruiData/conda/envs/cffn/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1372, in _process_data
data.reraise()
File "/root/siton-data-wangruiData/conda/envs/cffn/lib/python3.8/site-packages/torch/_utils.py", line 705, in reraise
raise exception
Original Traceback (most recent call last): File "/root/siton-data-wangruiData/conda/envs/cffn/lib/python3.8/site-packages/torch/utils/data/_utils/worker.py", line 308, in _worker_loop data = fetcher.fetch(index) # type: ignore[possibly-undefined] File "/root/siton-data-wangruiData/conda/envs/cffn/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 54, in fetch return self.collate_fn(data) File "/root/siton-data-wangruiData/conda/envs/cffn/lib/python3.8/site-packages/torch/utils/data/_utils/collate.py", line 316, in default_collate return collate(batch, collate_fn_map=default_collate_fn_map) File "/root/siton-data-wangruiData/conda/envs/cffn/lib/python3.8/site-packages/torch/utils/data/_utils/collate.py", line 173, in collate return [collate(samples, collate_fn_map=collate_fn_map) for samples in transposed] # Backwards compatibility. File "/root/siton-data-wangruiData/conda/envs/cffn/lib/python3.8/site-packages/torch/utils/data/_utils/collate.py", line 173, in
return [collate(samples, collate_fn_map=collate_fn_map) for samples in transposed] # Backwards compatibility.
File "/root/siton-data-wangruiData/conda/envs/cffn/lib/python3.8/site-packages/torch/utils/data/_utils/collate.py", line 191, in collate
raise TypeError(default_collate_err_msg_format.format(elem_type))
TypeError: default_collate: batch must contain tensors, numpy arrays, numbers, dicts or lists; found <class 'NoneType'>
.
Thanks to the author for his contribution to the detection of fake news, I just followed your instructions to install the environment, but the above problem occurred.