Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Process the video" error: 'log_dir' defined twice (absl.logging & src.config) #12

Open
andywise opened this issue Jun 17, 2019 · 18 comments

Comments

@andywise
Copy link

I'm hoping this is user error, but I'm getting this error during processing:

absl.flags._exceptions.DuplicateFlagError: The flag 'log_dir' is defined twice. First from absl.logging, Second from src.config.

Any ideas? Thanks for making this, and thanks in advance for your help!

@Dene33
Copy link
Owner

Dene33 commented Jun 17, 2019

Provide more information please. Step, video, etc.

@andywise
Copy link
Author

Sure thing!

This happens on the "Process the video" step immediately after PNGs and JSON files are created for each frame:

process-video_screenshot

Here's the video file I'm using.

@Dene33
Copy link
Owner

Dene33 commented Jun 17, 2019

I've checked and everything seems fine. Check Runtime > Change runtime type. That should be Python 3 with GPU.

@andywise
Copy link
Author

Huh. That's what I've been using.

Screen Shot 2019-06-17 at 3 25 19 PM

I'll keep trying. Thanks anyway.

@andywise
Copy link
Author

I started with a fresh notebook, followed all the readme instructions, and still got the same result, unfortunately. :/

Video uploads fine into the sample_videos folder.
Images are created fine in the sample_images folder.
JSONs are created successfully in the sample_jsons folder.

But once CSV conversion begins, it seems like it's not able to create individual CSV files or a final joined CSV (nothing shows up in csv or csv_joined folders). According to the error log, it's because the log_dir flag is defined twice: once in absl.logging, and again in src.config.

This is all the same as the original error I posted:

absl.flags._exceptions.DuplicateFlagError: The flag 'log_dir' is defined twice. First from absl.logging, Second from src.config.

Glad it worked for you, @Dene33. Hopefully I'm just missing something minor. I'm out of my depth for how to address this myself, but posting here in case it's helpful for someone else.

@Dene33
Copy link
Owner

Dene33 commented Jun 17, 2019

Video upload is finished, right? Do you run next cell after the video is uploaded completely?

@andywise
Copy link
Author

andywise commented Jun 18, 2019

Right. Yep.

Screen Shot 2019-06-18 at 6 45 22 AM

@muenchmark
Copy link

I'm seeing the exact same error. It uploads the video correctly, converts it to images, and processes a ton of images correctly...and then starts giving the log_dir error on every frame and eventually causes Blender to terminate because it can't find the csv_joined.csv file.

@Dene33
Copy link
Owner

Dene33 commented Jun 19, 2019

I think the error may appear because of the wrong tensorflow version. 1.3.0 is needed. I'll look into this.

@muenchmark
Copy link

I think if you change 'log_dir' in line 59 of https://github.com/Dene33/hmr/blob/master/src/config.py to 'logging_dir' it will fix the problem. Also, hmr says that it should be run with Python 2.7 and you specify to set the runtime to Python 3...is that correct? Thanks for posting this and thanks for your help!

@Dene33
Copy link
Owner

Dene33 commented Jun 20, 2019

There are two versions of Python used here, that's not the problem I guess. Please, try changing config.py and let me know about the results. Thanks.

@muenchmark
Copy link

Today I tested the change I mentioned above, replacing the three occurrences of 'log_dir' with 'logging_dir' in config.py and that fixed the problem with duplicate definitions. In order to get everything to run without errors, I also had to fold in the changes from Issue#69 on the original HMR project: akanazawa/hmr#69. Thanks!

@Dene33
Copy link
Owner

Dene33 commented Jun 30, 2019

Today I tested the change I mentioned above, replacing the three occurrences of 'log_dir' with 'logging_dir' in config.py and that fixed the problem with duplicate definitions. In order to get everything to run without errors, I also had to fold in the changes from Issue#69 on the original HMR project: akanazawa/hmr#69. Thanks!

It would be nice if you make pull requests with changes. :)

@maartenjv
Copy link

Hello, I'm having the same issue with the duplicate definitions. How can I make the changes that muenchmark suggested in the colab notebook? There seems to be no way to edit the source files?

Thanks.

@anjoeaj
Copy link

anjoeaj commented Jul 24, 2019

Hello, I'm having the same issue with the duplicate definitions. How can I make the changes that muenchmark suggested in the colab notebook? There seems to be no way to edit the source files?

Thanks.

Open the file on Google Drive - config.py (Either you can download it, edit and re-upload, or connect to some drive text editor to edit it online). Replace all instances of log_dir to log_dir1 or any other unique name. Run the script again.

@anjoeaj
Copy link

anjoeaj commented Jul 24, 2019

If you did not mount your Google Drive before running the notebook, the run the following code with the correct path to video_to_bvh. This way, it would be easier for you to organize and edit any files if needed.

from google.colab import drive
drive.mount('/content/drive')

import os, sys
os.chdir('/content/drive/My Drive/{path}/video_to_bvh')
sys.path.append('/content/drive/My Drive/{path}/video_to_bvh')
ROOT_DIR = os.path.abspath(".")

@timtensor
Copy link

i tried to delete the file and upload the changed file , but i cant seem to move it to src directory. I am not used to google colab , Is there a easy work around ?

@danielajisafe
Copy link

danielajisafe commented Jul 24, 2021

i tried to delete the file and upload the changed file , but i cant seem to move it to src directory. I am not used to google colab , Is there a easy work around ?

You can simply drag and drop the file in src folder.

tree

Once you are done, add the ffg code in a new cell to update, as Colab (from my experience) still use the old version of the file.

%load_ext autoreload
%autoreload 2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants