I have setup google datalab on my local machine then tried to read dataset using pandas by passing custom data directory but it doesn't take path correctly it adds root at the start then try to pass absolute path then it gives error file doesn't exist but file is in the directory.
Can any one help me what is the issue or anyone explain me is there any predefined rule to put the dataset
If you ran Datalab as a docker container on your local machine, it automatically maps your home directory to /content inside the container, so just make sure your Dataset is accessible from your home path.
Related
How do I change initial path directory in Jupyter lab, when i want to get a file via "~/"?
Have tried to generate config, and then change some parameters but only got confused.
You can change file directory like that.
import shutil
File= r'C:\Users\ivan\Desktop\Somewhereidonotknow\example.csv'
Whereyou_want= r'C:\Users\ivan\Desktop\example.csv'
shutil.move(File, Whereyou_want)
You should be using the %cd magic command to change the working directory. And then to set up using tab completion, you'd start by typing ./ before hitting tab at the place where you want to choose your CSV file.
In the demonstration set-up for the screenshot below I made a test directory in the root (home) location and made two CSV files in there.
Using %cd test first I am then able to use tab completion to get the option to select one of the two CSV files:
I probably should have included running pwd to 'print the working directoryafter I ran the%cd test` command to demonstrate things more fully.
Before I executed the command %cd test, the tab-completion was showing the root (home directory) when I tried for tab completion.
The tilde symbol (~) always means the HOME directory on the system. It won't change. So you were always specifying to start in HOME in your example in your post, no matter what the current working directory is in the notebook's active namespace. You want to use relative paths for when the working directory has been adjusted.
There are more complex settings you can take advantage of using inside the notebook in conjunction with the %cd magic.
For example, this post and answer shows how you can use the %boookmark magic to set assign a directory to a bookmark setting and then you can more easily switch around to various directories using %cd.
I'm a noob to Google Colab and Python. I'm attempting to import a custom set of scripts from a Github directory. I'm using the following:
!git clone https://github.com/theAIGuysCode/tensorflow-yolov4-tflite.git
By default, this will export to a folder that it names based on the git name. However, the functions in the needed scripts call the parent directory and not the git folder name. Example:
Google Colab Screenshot
Is there a method for importing the git in the parent directory so the scripts can run without modifying the file hierarchy in each script?
The error is that you are in a different directory. Most likely current directory is /content/ if those two cells in the picture are on top.
You need to change directory before you can call save_model.py, then it will work as expected. Use !pwd to know the current directory.
Before the last cell change directory to the one where desired code is. So in this case it can be,
%cd "/content/tensorflow-yolov4-tflite"
If you are unsure about path, right click on folder and select Copy path to use with cd command.
I am doing Stanford's course CS231n on deep learning and am using Google Colab.
The initialization code and all the files are given, so all i need is just to hit "run" on the given code.
I have followed step be step the official instructions and successfully mounted Google Drive, yet i get an error when trying to read the files:
"cp: cannot stat 'cs231n/assignments/assignment1/cs231n/': No such file or directory /content".
And then some more errors.
The files are located in my drive as in the path "FOLDERNAME".
The errors i get:
How it should be:
Official instructions:
https://cs231n.github.io/assignments2020/assignment1/
How can i solve it?
Thanks!
I am having the exactly same problem as you were. And here is my solution:
delete the folder named cs231n
follow the tutorial again
3. change the path %cd drive/My\ Drive into %cd drive/MyDrive
As you can see, default setting of the folder is 'MyDrive'(without space in midddle) but not 'My Drive'(My\ Drive).
Then, everything should run as your expectation.
Cheers.
Based on the course instructions, it sounds like you need to expand the course archive in your Drive.
Quoting here:
Create a folder in your personal Google Drive and upload assignment1/
folder to the Drive folder. We recommend that you call the Google
Drive folder cs231n/assignments/ so that the final uploaded folder has
the path cs231n/assignments/assignment1/.
If you already did that, I'd check the Drive web UI to make sure that the paths line up with the course instructions, and to move the files around if there's a mismatch.
I can store files to the specified storage location via the GUI. I can see the files are in the storage location.
When I try to download them using the GUI, I get this every time.
{"error":{"code":3,"message":"Unauthorized request","class":"Directus\\Exception\\UnauthorizedException","file":"\/var\/www\/directus\/src\/helpers\/app.php","line":287}}
When I try the links from the File library, I get the same error.
I found some old topics concerning a "_" project. I do not see any "_" entries in my project.php configuration.
Everyone has read permissions for the storage directory.
The rest of the system appears to run without error.
check the folder in the server and what is been set, the default should be, like
So then if you want to access the 300x300 the URL should be like:
domain.com/public/uploads/Directus/generated/w300,h300,fcrop,q80/file-name.jpg
I am trying to use an environment variable in the odoo.conf
file to specify the path where the logs are stored.
So far I have tried:
logfile = ${test.rueda}/odoo.log
But it does not work.
Is there any way to achieve this?
The Odoo configuration files do not support access to environment variables.
I can think of 2 possible approaches:
Use relative paths. The file names in the configuration are relative to the working directory of the Odoo server process. Start the Odoo server in different directories, one for every purpose, and keep the same structure relative to that.
Use environment variables in the command line. When starting the Odoo server, any configuration option can be passed using -- (2 dash signs) as a prefix. In the start script, you can then use environment variables as in any other shell script.
See https://www.odoo.com/documentation/11.0/reference/cmdline.html for details.
For referencing files or path:
When i work without external disk (where i can find my datadir):
i use in odoo config file data_dir = my_absolute_path_in_my_local_disk.
This path have a symbolic redirection to where is my local physical location of my local data directory
When my external disk come back, i change the symbolic link:
my_absolute_path_in_my_local_disk -> my_external_disk_..._data