xuebinqin / U-2-Net

The code for our newly accepted paper in Pattern Recognition 2020: "U^2-Net: Going Deeper with Nested U-Structure for Salient Object Detection."
Apache License 2.0
8.47k stars 1.46k forks source link

run python u2net_portrait_demo.py error #100

Open oops20180325 opened 3 years ago

oops20180325 commented 3 years ago

my PyTorch version is 1.7.0

(u2net) D:\ai\U^2-Net\U-2-Net>python u2net_portrait_demo.py Number of images: 11

inferencing 0 / 11 ./test_data/test_portrait_images/your_portrait_im\GalGadot.jpg D:\soft\anaconda3\envs\u2net\lib\site-packages\torch\nn\functional.py:2952: UserWarning: nn.functional.upsample is deprecated. Use nn.functional.interpolate instead. warnings.warn("nn.functional.upsample is deprecated. Use nn.functional.interpolate instead.") D:\soft\anaconda3\envs\u2net\lib\site-packages\torch\nn\functional.py:3063: UserWarning: Default upsampling behavior when mode=bilinear is changed to align_corners=False since 0.4.0. Please specify align_corners=True if the old behavior is desired. See the documentation of nn.Upsample for details. "See the documentation of nn.Upsample for details.".format(mode)) D:\soft\anaconda3\envs\u2net\lib\site-packages\torch\nn\functional.py:1639: UserWarning: nn.functional.sigmoid is deprecated. Use torch.sigmoid instead. warnings.warn("nn.functional.sigmoid is deprecated. Use torch.sigmoid instead.")

woctezuma commented 3 years ago

These are warnings, not errors.

jzz3933 commented 3 years ago

I also got these warnings, and there is no output in the output folder, I'm working on it

xuebinqin commented 3 years ago

when running the code in windows, please change the separators "/" in the image and model weight path " ./test_data/test_portrait_images/your_portrait_im\GalGadot.jpg" to "\".

On Mon, Nov 30, 2020 at 8:13 PM jzz3933 notifications@github.com wrote:

I also got these warnings, and there is no output in the output folder, I'm working on it

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/NathanUA/U-2-Net/issues/100#issuecomment-736189107, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADSGORI2QI35YDNQXWO5H6TSSRNMZANCNFSM4UA6MAAA .

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

jzz3933 commented 3 years ago

when running the code in windows, please change the separators "/" in the image and model weight path " ./test_data/test_portrait_images/your_portrait_im\GalGadot.jpg" to "\". On Mon, Nov 30, 2020 at 8:13 PM jzz3933 @.***> wrote: I also got these warnings, and there is no output in the output folder, I'm working on it — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub <#100 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADSGORI2QI35YDNQXWO5H6TSSRNMZANCNFSM4UA6MAAA . -- Xuebin Qin PhD Department of Computing Science University of Alberta, Edmonton, AB, Canada Homepage:https://webdocs.cs.ualberta.ca/~xuebin/

Thanks! It works well now!

gurusura commented 3 years ago

I am getting this error.

"RuntimeError: Attempting to deserialize object on a CUDA device but torch.cuda.is_available() is False. If you are running on a CPU-only machine, please use torch.load with map_location=torch.device('cpu') to map your storages to the CPU."