Coder Social home page Coder Social logo

shutil.SameFileError about consingan HOT 7 CLOSED

bycloudai avatar bycloudai commented on July 18, 2024
shutil.SameFileError

from consingan.

Comments (7)

bycloudai avatar bycloudai commented on July 18, 2024 2

I tried the

the error is still:
File "main_train.py", line 106 copytree(osp.join(current_path, "ConSinGAN"), osp.join(dir2save, "ConSinGAN")) ^ SyntaxError: invalid syntax

Nevermind, I missed a closing bracket, sorry.
Changing it to
copyfile(py_file, osp.join(dir2save, py_file.split("\\")[-1]))
does work, thank you.

from consingan.

tohinz avatar tohinz commented on July 18, 2024 1

Please try
copyfile(py_file, osp.join(dir2save, py_file.split("\\")[-1]))

from consingan.

Lannister0910 avatar Lannister0910 commented on July 18, 2024 1

I also have the same problem .I use this way and it does work.thank you!

from consingan.

tohinz avatar tohinz commented on July 18, 2024

Hm, are you using Windows?
Can you add print(dir2save) before the line that causes the error and check the output (should be something like "ConSinGAN-master/TrainedModels/scream/...").

from consingan.

bycloudai avatar bycloudai commented on July 18, 2024

my dir2save is:
TrainedModels/scream/2020_04_07_22_20_08_harmonization_train_depth_3_lr_scale_0.1_BN_act_lrelu_0.3
and yep I am using windows.

from consingan.

tohinz avatar tohinz commented on July 18, 2024

I guess it might have something to do with Windows using "\" instead of "/" (as Ubuntu does) in paths. Does it create the dir2save folder?
What are the paths for py_file and the osp.join() operation in line 105? Does it work if you replace "/" with "\" in py_file.split("/") line 105?
You'll likely have to replace all "/" with "\" in every operation that saves/loads files to/from the hard drive (also in training_harmonization_editing.py)

from consingan.

bycloudai avatar bycloudai commented on July 18, 2024

I've edited the line to:
line 106:
copyfile(py_file, osp.join(dir2save, py_file.split("\\"[-1]))

and this is the error:
File "main_train.py", line 106 copytree(osp.join(current_path, "ConSinGAN"), osp.join(dir2save, "ConSinGAN")) ^ SyntaxError: invalid syntax

It does create a folder in TrainedModels/scream but it only contains parameter

from consingan.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.