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

raise InvalidGitRepositoryError(epath) git.exc.InvalidGitRepositoryError: #4

Open
chengkeng opened this issue Feb 4, 2021 · 3 comments

Comments

@chengkeng
Copy link

chengkeng commented Feb 4, 2021

Hi!
I tried the example and felt very cool!
But when I trained my model, an error occurred in batch = [1501/20695].
The content is as follows:


(neural-style-transfer-fast) C:\MyWork\My_GAN_Work\pytorch-neural-style-transfer-fast-master>python training_script.py --style_img_name guanyu.png
Using 165560 datapoints (41390 batches) (MS COCO images) for transformer network training.
Learning the style of guanyu.png style image.


Hyperparams: content_weight=1.0, style_weight=400000.0 and tv_weight=0


Logging to console every 500 batches.
Saving checkpoint models every 2000 batches.
Tensorboard enabled.
Run "tensorboard --logdir=runs --samples_per_plugin images=50" from your conda env
Open http://localhost:6006/ in your browser and you're ready to use tensorboard!


time elapsed=0.00[min]|epoch=1|batch=[1/20695]|c-loss=0.024014575958251953|s-loss=0.09249082946777344|tv-loss=0.0|total loss=0.11650540542602539
time elapsed=1.18[min]|epoch=1|batch=[501/20695]|c-loss=6.4460309705734256|s-loss=6.1190721788406375|tv-loss=0.0|total loss=12.565103149414062
time elapsed=2.37[min]|epoch=1|batch=[1001/20695]|c-loss=5.169563026428222|s-loss=3.0164252252578736|tv-loss=0.0|total loss=8.185988251686096
time elapsed=3.58[min]|epoch=1|batch=[1501/20695]|c-loss=4.590205996513367|s-loss=2.6954647307395936|tv-loss=0.0|total loss=7.285670727252961
Traceback (most recent call last):
File "training_script.py", line 160, in
train(training_config)
File "training_script.py", line 96, in train
training_state = utils.get_training_metadata(training_config)
File "C:\MyWork\My_GAN_Work\pytorch-neural-style-transfer-fast-master\utils\utils.py", line 230, in get_training_metadata
"commit_hash": git.Repo(search_parent_directories=True).head.object.hexsha,
File "C:\Users\Creator\miniconda3\envs\neural-style-transfer-fast\lib\site-packages\git\repo\base.py", line 181, in init
raise InvalidGitRepositoryError(epath)
git.exc.InvalidGitRepositoryError: C:\MyWork\My_GAN_Work\pytorch-neural-style-transfer-fast-master


I did not find a solution on Google.
Is there any way to make it work?
I am looking forward to the effect after training!
Thank you!

@slyman928
Copy link

slyman928 commented Apr 18, 2021

you ever figure this out? having the exact same issue. it's an issue with git pretty sure, not the nst script

@slyman928
Copy link

git clone https://github.com/gordicaleksa/pytorch-neural-style-transfer-johnson

and then follow the setup, should work

@robertgoacher
Copy link

I can confirm that cloning the repo first eliminates this error.

Originally I had just put the files from the repo into the working directory manually and I too got the above error when I tried to train the network.

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

3 participants