Closed timegate closed 5 years ago
Under the hood we are using https://docs.python.org/3/library/pathlib.html#module-pathlib which deals deal with linux/macos and windows paths. As far as I am aware, this works. I and others have tested DLC on Windows (and Linux) and it works fine. Your suggested fix is highly brittle, as it is hard coded.
Perhaps you could highlight cases, where what you are saying:"But somehow, the path strings were changed to strings which have only one slashes even if some codes need the path with two slashes (I don't know why)." happens? I was not able to find such problems. Those should be fixed.
Hello, maybe I have the same question.
Environment Win10 x64, DLC2, CUDA8.0, TF-GPU1.4.0, python3.5.5, Cython, Anaconda Env
In function create_new_project, if I set copy_videos=True. It shows "TypeError: _isdir: illegal type for path parameter". So I set copy_videos=False to escape from the problem.
But when I try to create_training_dataset it happened again. I can't flight anymore.
When you run deeplabcut. create_new_project
Do this instead: config_path = deeplabcut. create_new_project(...
Then at least you have a variable you can easily pass instead of the string every time for the config path!
Here is a demo video of how I use the terminal to create a project: https://www.youtube.com/watch?v=7xwOhUcIGio
We will look into the copy=True part
I had similar issues, it seems that os
on windows doesn't deal well with Path
objects.
The solution was to call str()
on the path object within the os.path.isdir()
or any other os
or shutil
call within the script [it's only handful of places where it is raises errors].
I see: We should be using this: https://docs.python.org/3/library/os.html#os.fspath
Ok, please check the latest push. Uses fspath at the spots where you had trouble.
Hi, i am using Ubuntu 16.04, DLC, deeplabcut=2.0.0, virtualenv, and have the same error when setting copy_videos=True:
create_new_project(project, experimenter, videos, working_directory, copy_videos, videotype) 111 print("Copying the videos") 112 for src, dst in zip(videos, destinations): --> 113 shutil.copy(os.fspath(src),os.fspath(dst)) #https://www.python.org/dev/peps/pep-0519/ 114 #https://github.com/AlexEMG/DeepLabCut/issues/105 (for windows) 115
AttributeError: module 'os' has no attribute 'fspath'
fspath is part of the python3 os package: https://docs.python.org/3/library/os.html
Are you using Python2 https://docs.python.org/2/library/os.html ?
i am using Python 3.5.2 - should i upgrade to 3.6.3?
yeah it got solved with using python 3.6 within the virtualenv. thanks!
I have a related issue but when running deeplabcut.create_training_dataset(config_path,num_shuffles=1)
I'm using a Windows Server 2016 machine and I have trouble updating to python 3.6 (I have python 3.5)
`--------------------------------------------------------------------------- TypeError Traceback (most recent call last) c:\programdata\anaconda3\envs\tensorflow15\lib\site-packages\deeplabcut\utils\auxiliaryfunctions.py in attempttomakefolder(foldername, recursive) 57 try: ---> 58 os.path.isdir(foldername) 59 except TypeError: #https://www.python.org/dev/peps/pep-0519/
TypeError: _isdir: illegal type for path parameter
During handling of the above exception, another exception occurred:
AttributeError Traceback (most recent call last)
Yep, unfortunately you’ll have to upgrade to 3.6
Your Operating system and DeepLabCut version Windows 10, Anaconda Env & DeepLabCut2.0
Is your feature request related to a problem? Please describe. Issue99(https://github.com/AlexEMG/DeepLabCut/issues/99) Problem happened when 3.create_new_project with copy_videos=True.
Describe the solution you'd like Here is an email I sent to Mackenzie Mathis yesterday(But I haven't get no reply.. maybe she is busy?).
Hello,I wrote a issue(https://github.com/AlexEMG/DeepLabCut/issues/99) 3 days ago and now I find that below fixing can solve the problem 3.create_new_project with copy_videos=True.
I realized that it is the problem specified to windows. For windows users, we should add this code to new.py(Anaconda3\envs(your env name)\Lib\site-packages\deeplabcut\create_project\new.py)
Before explanation,
I want to make sure that I have run the code with two slashes(not one slash). It's not the problem caused by the fact that I didn't follow your instruction.
video=['C:\Users\user\Desktop\Video_files_Deeplabcut\LinearChamber\20180906\Trial1.mpg'] # Enter the paths of your videos you want to grab frames from.
deeplabcut.create_new_project(task,experimenter,video, working_directory='C:\Users\user\Desktop', copy_videos=False) #change the working directory to where you want the folders created.
But somehow, the path strings were changed to strings which have only one slashes even if some codes need the path with two slashes (I don't know why).
1) I made a simple func that change existing string() to new string which have double slashes(\)
def double_slash(str):
2) I changed (maybe line 103~?)
3)Also, I changed (maybe line 125~?)
Then it works. Could you please check this on windows 10 with conda environment?
Also, may I recieve a invitation message for deeplabcut slack group?