lanpa / tensorboardX

tensorboard for pytorch (and chainer, mxnet, numpy, ...)
https://tensorboardx.readthedocs.io/en/latest/tensorboard.html
MIT License
7.85k stars 865 forks source link

change unittest multiprocess start method to fork #702

Closed lanpa closed 1 year ago

lanpa commented 1 year ago
tests/test_multiprocess_write.py:72:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../../miniconda3/envs/tbx311/lib/python3.11/multiprocessing/process.py:121: in start
    self._popen = self._Popen(self)
../../miniconda3/envs/tbx311/lib/python3.11/multiprocessing/context.py:224: in _Popen
    return _default_context.get_context().Process._Popen(process_obj)
../../miniconda3/envs/tbx311/lib/python3.11/multiprocessing/context.py:288: in _Popen
    return Popen(process_obj)
../../miniconda3/envs/tbx311/lib/python3.11/multiprocessing/popen_spawn_posix.py:32: in __init__
    super().__init__(process_obj)
../../miniconda3/envs/tbx311/lib/python3.11/multiprocessing/popen_fork.py:19: in __init__
    self._launch(process_obj)
../../miniconda3/envs/tbx311/lib/python3.11/multiprocessing/popen_spawn_posix.py:47: in _launch
    reduction.dump(process_obj, fp)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

obj = <Process name='Process-21' parent=84214 initial>, file = <_io.BytesIO object at 0x13b315170>, protocol = None

    def dump(obj, file, protocol=None):
        '''Replacement for pickle.dump() using ForkingPickler.'''
>       ForkingPickler(file, protocol).dump(obj)
E       AttributeError: Can't pickle local object 'GlobalWriterTest.test_writer.<locals>.train3'
codecov-commenter commented 1 year ago

Codecov Report

Patch and project coverage have no change.

Comparison is base (9d51d9a) 84.83% compared to head (f9f5d23) 84.83%.

:exclamation: Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #702 +/- ## ======================================= Coverage 84.83% 84.83% ======================================= Files 36 36 Lines 2104 2104 ======================================= Hits 1785 1785 Misses 319 319 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

lanpa commented 1 year ago

This fixes error while running on mac