Giter Club home page Giter Club logo

Comments (5)

WasQian avatar WasQian commented on June 28, 2024

你好,请问一下你train_data数据集是从哪下载的, 因为train.py包含:
tra_image_dir = os.path.join('DUTS', 'DUTS-TR', 'DUTS-TR', 'im_aug' + os.sep)
tra_label_dir = os.path.join('DUTS', 'DUTS-TR', 'DUTS-TR', 'gt_aug' + os.sep)

from ieee_tip_uiu-net.

gottastudy avatar gottastudy commented on June 28, 2024

from ieee_tip_uiu-net.

HowCCB avatar HowCCB commented on June 28, 2024

您好,我在使用其它两种数据集训练时,在一个epoch下,不同批次会出现报错 l0: 0.010986, l1: 0.011472, l2: 0.014452, l3: 0.004034, l4: 0.004883, l5: 0.013490, l6: 0.004046

[epoch: 1/500, batch: 45/ 213, ite: 15] train loss: 0.884871, tar: 0.183994 Traceback (most recent call last): File "D:\contrast-methods\IEEE_TIP_UIU-Net-main\train.py", line 139, in for i, data in enumerate(salobj_dataloader): File "C:\Users\hp-\AppData\Roaming\Python\Python311\site-packages\torch\utils\data\dataloader.py", line 630, in next data = self._next_data() ^^^^^^^^^^^^^^^^^ File "C:\Users\hp-\AppData\Roaming\Python\Python311\site-packages\torch\utils\data\dataloader.py", line 1345, in _next_data return self._process_data(data) ^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\hp-\AppData\Roaming\Python\Python311\site-packages\torch\utils\data\dataloader.py", line 1371, in _process_data data.reraise() File "C:\Users\hp-\AppData\Roaming\Python\Python311\site-packages\torch_utils.py", line 694, in reraise raise exception RuntimeError: Caught RuntimeError in DataLoader worker process 0. Original Traceback (most recent call last): File "C:\Users\hp-\AppData\Roaming\Python\Python311\site-packages\torch\utils\data_utils\worker.py", line 308, in _worker_loop data = fetcher.fetch(index) ^^^^^^^^^^^^^^^^^^^^ File "C:\Users\hp-\AppData\Roaming\Python\Python311\site-packages\torch\utils\data_utils\fetch.py", line 54, in fetch return self.collate_fn(data) ^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\hp-\AppData\Roaming\Python\Python311\site-packages\torch\utils\data_utils\collate.py", line 265, in default_collate return collate(batch, collate_fn_map=default_collate_fn_map) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\hp-\AppData\Roaming\Python\Python311\site-packages\torch\utils\data_utils\collate.py", line 127, in collate return elem_type({key: collate([d[key] for d in batch], collate_fn_map=collate_fn_map) for key in elem}) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\hp-\AppData\Roaming\Python\Python311\site-packages\torch\utils\data_utils\collate.py", line 127, in return elem_type({key: collate([d[key] for d in batch], collate_fn_map=collate_fn_map) for key in elem}) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\hp-\AppData\Roaming\Python\Python311\site-packages\torch\utils\data_utils\collate.py", line 119, in collate return collate_fn_map[elem_type](batch, collate_fn_map=collate_fn_map) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\hp-\AppData\Roaming\Python\Python311\site-packages\torch\utils\data_utils\collate.py", line 162, in collate_tensor_fn return torch.stack(batch, 0, out=out) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ RuntimeError: torch.cat(): input types can't be cast to the desired output type Byte。 请问这种错误有解决方案吗?

你好,我也遇到这个问题了,请问您解决了吗

from ieee_tip_uiu-net.

guoxueqiang avatar guoxueqiang commented on June 28, 2024

将num_workers改成0貌似就可以了。

from ieee_tip_uiu-net.

bobo66597 avatar bobo66597 commented on June 28, 2024

作者为了提速把num_workers设置为1,就是多一个子进程数量,在train.py文件里面找到如下代码把num_workers改成0就好了,但是训练速度会下降
salobj_dataset = SalObjDataset(
img_name_list=tra_img_name_list,
lbl_name_list=tra_lbl_name_list,
transform=transforms.Compose([
RescaleT(320),
RandomCrop(288),
ToTensorLab(flag=0)]))
salobj_dataloader = DataLoader(salobj_dataset, batch_size=batch_size_train, shuffle=False, num_workers=0, drop_last=True) #shuffle=True 乱序

from ieee_tip_uiu-net.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.