Pytorch Cityscapes Dataset, train_distribute problem - "Typeerror: path should be string, bytes, pathlike or integer, not NoneType"
I'm very unfamiliar with Machine Learning, python, and such, so forgive my oblivious errors. I'm trying to use machine learning systems on a dataset of streetscapes I have. I found a lot or resources, and I'm working off of this package which has a lot of examples and seems straightforward.
When I attempted to run the train_distribute.py file, I received this error:
(base) corey@corona:~/Desktop/pycity/GALD-Net-master$ python train_distribute.py
 
Traceback (most recent call last):
  File &quot;train_distribute.py&quot;, line 261, in &lt;module&gt;
    main()
  File &quot;train_distribute.py&quot;, line 136, in main
    if not os.path.exists(args.save_dir):
  File &quot;/home/corey/anaconda3/lib/python3.7/genericpath.py&quot;, line 19, in exists
    os.stat(path)
TypeError: stat: path should be string, bytes, os.PathLike or integer, not NoneType

Looking in the code, it's coming from these lines:
def main():

    # make save dir
    if args.local_rank == 0:
        if not os.path.exists(args.save_dir):
            os.makedirs(args.save_dir)
    # launch the logger
    Log.init(
        log_level=args.log_level,

I'm guessing this means I need a more exact file structure, and to point the code at the right location. I am in no way a computer scientist and have close to zero understanding of what does what and how things like this work. Any advice for what I'm doing wrong and how I can approach fixing things?

From the error message, my guess would be that args.save_dir is None. os.path.exists cannot deal with None as a path:
&gt;&gt;&gt; import os
&gt;&gt;&gt; os.path.exists(None)
Traceback (most recent call last):
  File &quot;&lt;stdin&gt;&quot;, line 1, in &lt;module&gt;
  File &quot;/usr/lib/python3.8/genericpath.py&quot;, line 19, in exists
    os.stat(path)
TypeError: stat: path should be string, bytes, os.PathLike or integer, not NoneType

Looking at the script you cited, the save_dir argument has a default value of None. It might be useful to make this a required argument and remove the default value, since the main function depends on it.
