xuebinqin / BASNet

Code for CVPR 2019 paper. BASNet: Boundary-Aware Salient Object Detection
MIT License
1.35k stars 249 forks source link

您好 我想请教关于预训练模型的问题 #36

Closed Roylo-bot closed 4 years ago

Roylo-bot commented 4 years ago

我下载了您给出的预训练模型,并放在了所指定的文件夹内。 但是在运行test文件的时候,还是会从pytorch的网站上下载模型

xuebinqin commented 4 years ago

这个下载主要是用于初始化pre-trained ResNet-34. 在basnet_test.py中这些权重将会被DUTS-TR训练的模型参数覆盖。

On Sat, Feb 15, 2020 at 6:09 AM Roylo-bot notifications@github.com wrote:

我下载了您给出的预训练模型,并放在了所指定的文件夹内。 但是在运行test文件的时候,还是会从pytorch的网站上下载模型

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/NathanUA/BASNet/issues/36?email_source=notifications&email_token=ADSGORPEDFHRX2WX7XPPUXTRC7SQXA5CNFSM4KVYS3OKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4INYTGPQ, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADSGORPW67RQ2ZRRLREKII3RC7SQXANCNFSM4KVYS3OA .

-- Xuebin Qin PhD Candidate Department of Computing Science University of Alberta, Edmonton, AB, Canada Homepage:https://webdocs.cs.ualberta.ca/~xuebin/

Roylo-bot commented 4 years ago

十分感谢 。 还想请问一下 ,trian当中的train_data应该放在哪里呀?刚开始接触不太懂

Roylo-bot commented 4 years ago

是直接新建一个trian_data文件夹在目录下面吗?

xuebinqin commented 4 years ago

Yes, you can follow the following directories.

data_dir = './train_data/' tra_image_dir = 'DUTS/DUTS-TR/DUTS-TR/im_aug/' tra_label_dir = 'DUTS/DUTS-TR/DUTS-TR/gt_aug/' image_ext = '.jpg' label_ext = '.png'

On Wed, Feb 19, 2020 at 1:50 AM Roylo-bot notifications@github.com wrote:

是直接新建一个trian_data文件夹在目录下面吗?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/NathanUA/BASNet/issues/36?email_source=notifications&email_token=ADSGORM2LZ4O4XWY56UCUFLRDTXGPA5CNFSM4KVYS3OKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEMG4NFI#issuecomment-588105365, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADSGORKPEZD4RXZTPE2ZPQTRDTXGPANCNFSM4KVYS3OA .

-- Xuebin Qin PhD Candidate Department of Computing Science University of Alberta, Edmonton, AB, Canada Homepage:https://webdocs.cs.ualberta.ca/~xuebin/

Roylo-bot commented 4 years ago

十分感谢 在训练DUTS数据集的时候,我的显卡是6G的2060,batchsize只能设置为2,不然就会超了内存。 如果要跑完十万次epoch的话需要的时间太久了,请问可以怎样修改epoch的值呢?

Pandikk commented 4 years ago

十分感谢 在训练DUTS数据集的时候,我的显卡是6G的2060,batchsize只能设置为2,不然就会超了内存。 如果要跑完十万次epoch的话需要的时间太久了,请问可以怎样修改epoch的值呢?

我也有同样的困惑,请问你问题得到解决了吗

xuebinqin commented 4 years ago

你好,

谢谢你们的问题,training code 里面的epoch设置只是一个最大值,实际不需要训练那么久,你可以参考BASNet论文中的训练次数(约400K iterations with batch size of 8),你可以按此计算需要在batch size 为2 的情况下训练的迭代次数,但是batch size小的话可能对模型性能有影响。

On Fri, May 15, 2020 at 5:43 AM Pandikk notifications@github.com wrote:

十分感谢 在训练DUTS数据集的时候,我的显卡是6G的2060,batchsize只能设置为2,不然就会超了内存。 如果要跑完十万次epoch的话需要的时间太久了,请问可以怎样修改epoch的值呢?

我也有同样的困惑,请问你问题得到解决了吗

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/NathanUA/BASNet/issues/36#issuecomment-629188679, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADSGORKGE54M3GOMAHR553LRRUTERANCNFSM4KVYS3OA .

-- Xuebin Qin PhD Department of Computing Science University of Alberta, Edmonton, AB, Canada Homepage:https://webdocs.cs.ualberta.ca/~xuebin/

ouguozhen commented 3 years ago

这个下载主要是用于初始化pre-trained ResNet-34. 在basnet_test.py中这些权重将会被DUTS-TR训练的模型参数覆盖。 On Sat, Feb 15, 2020 at 6:09 AM Roylo-bot @.***> wrote: 我下载了您给出的预训练模型,并放在了所指定的文件夹内。 但是在运行test文件的时候,还是会从pytorch的网站上下载模型 — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub <#36?email_source=notifications&email_token=ADSGORPEDFHRX2WX7XPPUXTRC7SQXA5CNFSM4KVYS3OKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4INYTGPQ>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADSGORPW67RQ2ZRRLREKII3RC7SQXANCNFSM4KVYS3OA . -- Xuebin Qin PhD Candidate Department of Computing Science University of Alberta, Edmonton, AB, Canada Homepage:https://webdocs.cs.ualberta.ca/~xuebin/

实际上不用下载啊,模型也不需要load,只需要把网络定义好就行了

BarCodeReader commented 3 years ago

十分感谢 在训练DUTS数据集的时候,我的显卡是6G的2060,batchsize只能设置为2,不然就会超了内存。 如果要跑完十万次epoch的话需要的时间太久了,请问可以怎样修改epoch的值呢?

我也有同样的困惑,请问你问题得到解决了吗

都不看代码的吗,里面写的清清楚楚 epoch=100000 改了就完了啊。

xuebinqin commented 3 years ago

Recently, we replaced the BN in U-2-Net with GroupNorm (batch size = 1) to run on a small GPU. Although the results is slightly worse than the original batch size setting, But they are very close (1-2% difference in F1). So I think that could also helpful for using small batch size in BASNet.

On Fri, Feb 28, 2020 at 5:34 AM Roylo-bot notifications@github.com wrote:

十分感谢 在训练DUTS数据集的时候,我的显卡是6G的2060,batchsize只能设置为2,不然就会超了内存。 如果要跑完十万次epoch的话需要的时间太久了,请问可以怎样修改epoch的值呢?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/NathanUA/BASNet/issues/36?email_source=notifications&email_token=ADSGORILOKP4MGFCBGFENMDRFEAFBA5CNFSM4KVYS3OKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOENIL32I#issuecomment-592494057, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADSGORPDEMTIE3SQUDFKBZTRFEAFBANCNFSM4KVYS3OA .

-- Xuebin Qin PhD Department of Computing Science University of Alberta, Edmonton, AB, Canada Homepage:https://webdocs.cs.ualberta.ca/~xuebin/