# \[Solved\] Error uploading pictures

**URL:** <https://forum.mapillary.com/t/solved-error-uploading-pictures/3242>\
**Category:** Command line tools\
**Created:** [August 10, 2019, 2:11pm UTC](https://forum.mapillary.com/t/solved-error-uploading-pictures/3242 "2019-08-10T14:11:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tryl](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.mapillary.com/tryl/32/62_2.png) [@tryl](https://forum.mapillary.com/u/tryl)\
**Post date:** [August 10, 2019, 2:11pm UTC](https://forum.mapillary.com/t/solved-error-uploading-pictures/3242/1 "2019-08-10T14:11:24Z")

</div>

I have run video\_process on some video files along with a gpx file and wants to upload the pictures with:  
mapillary\_tools upload --advanced --import\_path “images/mapillary\_sampled\_video\_frames/” --number\_threads 4 --summarize --save\_as\_json --verbose --skip\_subfolders

This gives:  
All images have already been uploaded  
Done uploading 0 images.  
Traceback (most recent call last):  
File “/usr/local/bin/mapillary\_tools”, line 6, in   
exec(compile(open( **file** ).read(), **file** , ‘exec’))  
File “/home/tryl/almen/scripts/external/new\_mapillary\_tools/bin/mapillary\_tools”, line 76, in   
command.run(args)  
File “/home/tryl/almen/scripts/external/new\_mapillary\_tools/mapillary\_tools/commands/upload.py”, line 52, in run  
post\_process(\*\*({k: v for k, v in vars\_args.iteritems()  
File “/home/tryl/almen/scripts/external/new\_mapillary\_tools/mapillary\_tools/post\_process.py”, line 161, in post\_process  
import\_path, skip\_subfolders)  
File “/home/tryl/almen/scripts/external/new\_mapillary\_tools/mapillary\_tools/processing.py”, line 680, in get\_duplicate\_file\_list  
duplicate\_file\_list.extend(os.path.join(os.path.abspath(root\_dir), file) for file in os.listdir(root\_dir) if file.lower().endswith(  
NameError: global name ‘root\_dir’ is not defined

Actually I have not recorded what the first lines gave the first time, but it also finished with the same exception.

The above is after I updated to the latest version from git.

Any suggestion on how to fix this? Any suggestion on how to make the script upload files it believes are uploaded?

---

<div class="post-metadata">

**Author:** ![tryl](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.mapillary.com/tryl/32/62_2.png) [@tryl](https://forum.mapillary.com/u/tryl)\
**Post date:** [August 10, 2019, 3:56pm UTC](https://forum.mapillary.com/t/solved-error-uploading-pictures/3242/2 "2019-08-10T15:56:40Z")

</div>

It seems that the reason nothing was uploaded is because I used --skip\_subfolders and the images from each video file had been placed in a folder. It is only when the script generates a final report it fails - but it does not every time.

---

<div class="post-metadata">

**Author:** ![tryl](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.mapillary.com/tryl/32/62_2.png) [@tryl](https://forum.mapillary.com/u/tryl)\
**Post date:** [August 11, 2019, 5:12pm UTC](https://forum.mapillary.com/t/solved-error-uploading-pictures/3242/3 "2019-08-11T17:12:25Z")

</div>

The error only seems to come when there is nothing to upload, so I am good now.
