Zhaoyi-Yan / Shift-Net_pytorch

Pytorch implementation of Shift-Net: Image Inpainting via Deep Feature Rearrangement (ECCV, 2018)
http://openaccess.thecvf.com/content_ECCV_2018/papers/Zhaoyi_Yan_Shift-Net_Image_Inpainting_ECCV_2018_paper.pdf
MIT License
363 stars 83 forks source link

Optimization PB #19

Open tchaton opened 5 years ago

tchaton commented 5 years ago

Hello there,

The training was very slow. I started to look into the code (You can find the notebook for the optimization on my repo).

At my big surprise, it takes 0.5 s to forward with a square centered mask. I was expecting way more.

I checked with your random mask generator. while True: x = random.randint(1, MAX_SIZE-fineSize) y = random.randint(1, MAX_SIZE-fineSize) mask = pattern[y:y+fineSize, x:x+fineSize] # need check area = mask.sum()100./(fineSizefineSize) if area>20 and area<maxPartition: break wastedIter += 1

You have a while True that sometines never finishes. It took between 6 sec to 400 sec. I am going to remove it.

Zhaoyi-Yan commented 5 years ago

Hi, it shouldn't be that long. It shuold be less than 0.001s. I am not sure why it takes so long in your case.