mjkwon2021 / CAT-Net

Official code for CAT-Net: Compression Artifact Tracing Network. Image manipulation detection and localization.
210 stars 25 forks source link

CASIA2.0 notfoundfile #7

Closed dan326326 closed 2 years ago

dan326326 commented 2 years ago

Hi, I have seen the CASIA2.0 address in your code dataset_CASIA. Py, downloaded it, and set the layout and path of the dataset as required, but errors kept coming when running the code, the errors are as follows, I have also checked the path of the dataset, but they are all correct, I don't know why, could you give me some suggestions?

warnings.warn("nn.functional.upsample is deprecated. Use nn.functional.interpolate instead.") Epoch: [0/200] Iter:[0/1869], Time: 1069.73, lr: 0.005000, Loss: 0.695368 Traceback (most recent call last): File "train.py", line 234, in main() File "train.py", line 185, in main trainloader, optimizer, model, writer_dict, final_output_dir) File "E:\cat\tools..\lib\core\function.py", line 58, in train for i_iter, (images, labels, qtable) in enumerate(trainloader): File "C:\Users\dell\anaconda3\envs\cat\lib\site-packages\torch\utils\data\dataloader.py", line 568, in next return self._process_next_batch(batch) File "C:\Users\dell\anaconda3\envs\cat\lib\site-packages\torch\utils\data\dataloader.py", line 608, in _process_next_batch raise batch.exc_type(batch.exc_msg) FileNotFoundError: Traceback (most recent call last): File "C:\Users\dell\anaconda3\envs\cat\lib\site-packages\torch\utils\data_utils\worker.py", line 99, in _worker_loop samples = collate_fn([dataset[i] for i in batch_indices]) File "C:\Users\dell\anaconda3\envs\cat\lib\site-packages\torch\utils\data_utils\worker.py", line 99, in samples = collate_fn([dataset[i] for i in batch_indices]) File "E:\cat\tools..\Splicing\data\data_core.py", line 99, in getitem return self.dataset_list[index//self.smallest].get_tamp(index%self.smallest) File "E:\cat\tools..\Splicing\data\dataset_CASIA.py", line 55, in get_tamp return self._create_tensor(tamp_path, mask) File "E:\cat\tools..\Splicing\data\AbstractDataset.py", line 106, in _create_tensor img_RGB = np.array(Image.open(im_path).convert("RGB")) File "C:\Users\dell\anaconda3\envs\cat\lib\site-packages\PIL\Image.py", line 2912, in open fp = builtins.open(filename, "rb") FileNotFoundError: [Errno 2] No such file or directory: 'E:\cat\datasets\CASIA\CASIA 2.0\jpg\Tp_S_NNN_S_N_cha00089_cha00089_00871. jpg'

CauchyComplete commented 2 years ago

Did you run the renaming script as described in the comment? https://github.com/mjkwon2021/CAT-Net/blob/8e188224b9c3459c5ff60c1ef7d8e0dd2fab9353/Splicing/data/dataset_CASIA.py#L30

dan326326 commented 2 years ago

I didn't run it, but I checked the image that reported the error, its name was correct, and it was found in the dataset

CauchyComplete commented 2 years ago

If only few images are causing errors, why don’t you remove that images from txt file and train without them?

dan326326 commented 2 years ago

You're right. I have no experience in this field. Thank you for your help.

------------------ 原始邮件 ------------------ 发件人: "mjkwon2021/CAT-Net" @.>; 发送时间: 2021年11月11日(星期四) 晚上11:55 @.>; @.**@.>; 主题: Re: [mjkwon2021/CAT-Net] CASIA2.0 notfoundfile (Issue #7)

If only few images are causing errors, why don’t you remove that images from txt file and train without them?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.