Coder Social home page Coder Social logo

Comments (9)

ZLeopard avatar ZLeopard commented on July 23, 2024 2

ooooooh, i know the reason, just because the OS is Windows, In Windows, multiprocessing uses pickle to transfer objects between processes. Socket objects can not be pickled !!! It's ok in linux~

from pytorch-ssd.

drcdr avatar drcdr commented on July 23, 2024 2

I'm using Windows10 and recent pytorch. I was able to get things to run by :
(1) using num_workers = 0; or,
(2) using num_workers = 4, and:
(2a) replacing
lambda img, boxes=None, labels=None: (img / std, boxes, labels),
with a call to
ScaleStd(std),
in the 3 appropriate places in TrainAugmentation in data_preprocessing.py, and adding an appropriate ScaleStd function to transforms.py.

(2b) for safety, I also added:

    if __name__ == '__main__':
        main()

in train_ssd, see https://discuss.pytorch.org/t/if-name-main-for-window10/19377

Using num_workers=0: [~77s/100 steps]
2019-02-26 00:04:29,682 - root - INFO - Epoch: 0, Step: 100, Average Loss: 10.2757, Average Regression Loss 2.7290, Average Classification Loss: 7.5467
2019-02-26 00:05:47,321 - root - INFO - Epoch: 0, Step: 200, Average Loss: 7.1005, Average Regression Loss 2.3017, Average Classification Loss: 4.7987

Using num_workers=4: [~25s/100 steps]
2019-02-26 00:09:41,438 - root - INFO - Epoch: 0, Step: 100, Average Loss: 10.2432, Average Regression Loss 2.7734, Average Classification Loss: 7.4699
2019-02-26 00:10:05,654 - root - INFO - Epoch: 0, Step: 200, Average Loss: 6.9949, Average Regression Loss 2.2865, Average Classification Loss: 4.7084

So, ~3x speedup (in both cases, I'm reading files from an SSD drive).

I made a few other changes, but I think they are inconsequential. Let me know if this doesn't work for you, and I can check for other possible changes.

from pytorch-ssd.

ygean avatar ygean commented on July 23, 2024

@ZLeopard Hey, bro! Where and what should I change codes if I want to run on windows platform, I'd like to know your solutions or you just run on linux

from pytorch-ssd.

ZLeopard avatar ZLeopard commented on July 23, 2024

@zhouyuangan no, i have no idea about using the code in windows, you may search on the StackOverFlow, some like replace the pickle lib using another lib

from pytorch-ssd.

OakSuen avatar OakSuen commented on July 23, 2024

Hi, have you found the answer how to run the code in Windows, without this error?

from pytorch-ssd.

FanLu1994 avatar FanLu1994 commented on July 23, 2024

anybody solved this problem?

from pytorch-ssd.

lianxxx avatar lianxxx commented on July 23, 2024

It looks some problem with multi-processing, how about setting the num_workers = 0.

from pytorch-ssd.

drcdr avatar drcdr commented on July 23, 2024

@ZLeopard @zhouyuangan @OakSuen @CodeForWuyu @lianxxx updating you, as this issue is marked closed.

from pytorch-ssd.

littlerain2310 avatar littlerain2310 commented on July 23, 2024

can u find other solution ? It doesn't seem to work on my laptop

from pytorch-ssd.

Related Issues (20)

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.