Pytorch PermissionError: [Errno 13] Permission denied: '/.torch'How do I use sudo to redirect output to a location I don't have permission to write to?How do I change permissions for a folder and all of its subfolders and files in one step in Linux?ssh “permissions are too open” errorNo module named 'torch' or 'torch.C'Calling pytorch 0.4 from MatlabPytorch saving model UserWarning: Couldn't retrieve source code for container of type NetworkMemoryError when attempting to create a docker image with Torch/PyTorchPyTorch why does the forward function run multiple times and can I change the input shape?Pytorch torchvision MNIST downloadPyinstaller PermissionError: [Errno 13] difference between venv and regular in PyCharm?

The use of multiple foreign keys on same column in SQL Server

How to add power-LED to my small amplifier?

How do we improve the relationship with a client software team that performs poorly and is becoming less collaborative?

Pronouncing Dictionary.com's W.O.D "vade mecum" in English

Download, install and reboot computer at night if needed

Patience, young "Padovan"

How long does it take to type this?

Why has Russell's definition of numbers using equivalence classes been finally abandoned? ( If it has actually been abandoned).

How do I create uniquely male characters?

If Manufacturer spice model and Datasheet give different values which should I use?

Is it possible to make sharp wind that can cut stuff from afar?

I probably found a bug with the sudo apt install function

Simple device (fancy) pointer implementation

I’m planning on buying a laser printer but concerned about the life cycle of toner in the machine

Why don't electromagnetic waves interact with each other?

What do you call something that goes against the spirit of the law, but is legal when interpreting the law to the letter?

Is the month field really deprecated?

When blogging recipes, how can I support both readers who want the narrative/journey and ones who want the printer-friendly recipe?

Do any Labour MPs support no-deal?

"which" command doesn't work / path of Safari?

Can an x86 CPU running in real mode be considered to be basically an 8086 CPU?

Why is an old chain unsafe?

Why can't I see bouncing of a switch on an oscilloscope?

How to get the available space of $HOME as a variable in shell scripting?



Pytorch PermissionError: [Errno 13] Permission denied: '/.torch'


How do I use sudo to redirect output to a location I don't have permission to write to?How do I change permissions for a folder and all of its subfolders and files in one step in Linux?ssh “permissions are too open” errorNo module named 'torch' or 'torch.C'Calling pytorch 0.4 from MatlabPytorch saving model UserWarning: Couldn't retrieve source code for container of type NetworkMemoryError when attempting to create a docker image with Torch/PyTorchPyTorch why does the forward function run multiple times and can I change the input shape?Pytorch torchvision MNIST downloadPyinstaller PermissionError: [Errno 13] difference between venv and regular in PyCharm?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















I'm running a pytorch based ML program for image classification using Resnet50 model for transfer learning. I am getting below error regarding permission.




Traceback (most recent call last):



File "imgc_pytorch.py", line 67, in model =
models.resnet50(pretrained=True) File
"/opt/conda/lib/python3.6/site-packages/torchvision/models/resnet.py",
line 187, in resnet50
model.load_state_dict(model_zoo.load_url(model_urls['resnet50'])) File
"/opt/conda/lib/python3.6/site-packages/torch/utils/model_zoo.py",
line 59, in load_url os.makedirs(model_dir) File
"/opt/conda/lib/python3.6/os.py", line 210, in makedirs makedirs(head,
mode, exist_ok) File "/opt/conda/lib/python3.6/os.py", line 220, in
makedirs mkdir(name, mode) PermissionError: [Errno 13] Permission
denied: '/.torch'




Looked up on this forum and it was suggested to add 'sudo' before the file name, but getting error "/bin/sh: 1: sudo: not found"










share|improve this question
























  • I am deploying this code on a GPU cluster provided by my company

    – sigmoid
    Mar 9 at 3:46

















0















I'm running a pytorch based ML program for image classification using Resnet50 model for transfer learning. I am getting below error regarding permission.




Traceback (most recent call last):



File "imgc_pytorch.py", line 67, in model =
models.resnet50(pretrained=True) File
"/opt/conda/lib/python3.6/site-packages/torchvision/models/resnet.py",
line 187, in resnet50
model.load_state_dict(model_zoo.load_url(model_urls['resnet50'])) File
"/opt/conda/lib/python3.6/site-packages/torch/utils/model_zoo.py",
line 59, in load_url os.makedirs(model_dir) File
"/opt/conda/lib/python3.6/os.py", line 210, in makedirs makedirs(head,
mode, exist_ok) File "/opt/conda/lib/python3.6/os.py", line 220, in
makedirs mkdir(name, mode) PermissionError: [Errno 13] Permission
denied: '/.torch'




Looked up on this forum and it was suggested to add 'sudo' before the file name, but getting error "/bin/sh: 1: sudo: not found"










share|improve this question
























  • I am deploying this code on a GPU cluster provided by my company

    – sigmoid
    Mar 9 at 3:46













0












0








0








I'm running a pytorch based ML program for image classification using Resnet50 model for transfer learning. I am getting below error regarding permission.




Traceback (most recent call last):



File "imgc_pytorch.py", line 67, in model =
models.resnet50(pretrained=True) File
"/opt/conda/lib/python3.6/site-packages/torchvision/models/resnet.py",
line 187, in resnet50
model.load_state_dict(model_zoo.load_url(model_urls['resnet50'])) File
"/opt/conda/lib/python3.6/site-packages/torch/utils/model_zoo.py",
line 59, in load_url os.makedirs(model_dir) File
"/opt/conda/lib/python3.6/os.py", line 210, in makedirs makedirs(head,
mode, exist_ok) File "/opt/conda/lib/python3.6/os.py", line 220, in
makedirs mkdir(name, mode) PermissionError: [Errno 13] Permission
denied: '/.torch'




Looked up on this forum and it was suggested to add 'sudo' before the file name, but getting error "/bin/sh: 1: sudo: not found"










share|improve this question
















I'm running a pytorch based ML program for image classification using Resnet50 model for transfer learning. I am getting below error regarding permission.




Traceback (most recent call last):



File "imgc_pytorch.py", line 67, in model =
models.resnet50(pretrained=True) File
"/opt/conda/lib/python3.6/site-packages/torchvision/models/resnet.py",
line 187, in resnet50
model.load_state_dict(model_zoo.load_url(model_urls['resnet50'])) File
"/opt/conda/lib/python3.6/site-packages/torch/utils/model_zoo.py",
line 59, in load_url os.makedirs(model_dir) File
"/opt/conda/lib/python3.6/os.py", line 210, in makedirs makedirs(head,
mode, exist_ok) File "/opt/conda/lib/python3.6/os.py", line 220, in
makedirs mkdir(name, mode) PermissionError: [Errno 13] Permission
denied: '/.torch'




Looked up on this forum and it was suggested to add 'sudo' before the file name, but getting error "/bin/sh: 1: sudo: not found"







permissions pytorch






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 9 at 10:35









kHarshit

81211017




81211017










asked Mar 9 at 3:38









sigmoidsigmoid

135




135












  • I am deploying this code on a GPU cluster provided by my company

    – sigmoid
    Mar 9 at 3:46

















  • I am deploying this code on a GPU cluster provided by my company

    – sigmoid
    Mar 9 at 3:46
















I am deploying this code on a GPU cluster provided by my company

– sigmoid
Mar 9 at 3:46





I am deploying this code on a GPU cluster provided by my company

– sigmoid
Mar 9 at 3:46












1 Answer
1






active

oldest

votes


















0














you can change model_zoo.load_url(model_urls['resnet50']) to model_zoo.load_url(model_urls['resnet50'], model_dir='~/.torch/') like this






share|improve this answer























  • Since this is on the cluster, looks like the admin will have to do this right ?

    – sigmoid
    Mar 9 at 7:01











  • @sigmoid I guess not. I mean you still have a user there right? So it should be fine for you to download the pertained model in your home directory

    – Separius
    Mar 9 at 14:43











  • but the code and date is in a container....on the cluster

    – sigmoid
    Mar 9 at 16:07






  • 1





    thanks i will try that...wish i cud upvote you, but dont have enough rep

    – sigmoid
    Mar 10 at 3:01






  • 1





    TORCH_HOME=/mnt/test/torch export TORCH_HOME;cd /mnt/test;python imgc_pytorch.py did the trick. Works fine now

    – sigmoid
    Mar 11 at 9:15











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55073757%2fpytorch-permissionerror-errno-13-permission-denied-torch%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














you can change model_zoo.load_url(model_urls['resnet50']) to model_zoo.load_url(model_urls['resnet50'], model_dir='~/.torch/') like this






share|improve this answer























  • Since this is on the cluster, looks like the admin will have to do this right ?

    – sigmoid
    Mar 9 at 7:01











  • @sigmoid I guess not. I mean you still have a user there right? So it should be fine for you to download the pertained model in your home directory

    – Separius
    Mar 9 at 14:43











  • but the code and date is in a container....on the cluster

    – sigmoid
    Mar 9 at 16:07






  • 1





    thanks i will try that...wish i cud upvote you, but dont have enough rep

    – sigmoid
    Mar 10 at 3:01






  • 1





    TORCH_HOME=/mnt/test/torch export TORCH_HOME;cd /mnt/test;python imgc_pytorch.py did the trick. Works fine now

    – sigmoid
    Mar 11 at 9:15















0














you can change model_zoo.load_url(model_urls['resnet50']) to model_zoo.load_url(model_urls['resnet50'], model_dir='~/.torch/') like this






share|improve this answer























  • Since this is on the cluster, looks like the admin will have to do this right ?

    – sigmoid
    Mar 9 at 7:01











  • @sigmoid I guess not. I mean you still have a user there right? So it should be fine for you to download the pertained model in your home directory

    – Separius
    Mar 9 at 14:43











  • but the code and date is in a container....on the cluster

    – sigmoid
    Mar 9 at 16:07






  • 1





    thanks i will try that...wish i cud upvote you, but dont have enough rep

    – sigmoid
    Mar 10 at 3:01






  • 1





    TORCH_HOME=/mnt/test/torch export TORCH_HOME;cd /mnt/test;python imgc_pytorch.py did the trick. Works fine now

    – sigmoid
    Mar 11 at 9:15













0












0








0







you can change model_zoo.load_url(model_urls['resnet50']) to model_zoo.load_url(model_urls['resnet50'], model_dir='~/.torch/') like this






share|improve this answer













you can change model_zoo.load_url(model_urls['resnet50']) to model_zoo.load_url(model_urls['resnet50'], model_dir='~/.torch/') like this







share|improve this answer












share|improve this answer



share|improve this answer










answered Mar 9 at 5:03









SepariusSeparius

379313




379313












  • Since this is on the cluster, looks like the admin will have to do this right ?

    – sigmoid
    Mar 9 at 7:01











  • @sigmoid I guess not. I mean you still have a user there right? So it should be fine for you to download the pertained model in your home directory

    – Separius
    Mar 9 at 14:43











  • but the code and date is in a container....on the cluster

    – sigmoid
    Mar 9 at 16:07






  • 1





    thanks i will try that...wish i cud upvote you, but dont have enough rep

    – sigmoid
    Mar 10 at 3:01






  • 1





    TORCH_HOME=/mnt/test/torch export TORCH_HOME;cd /mnt/test;python imgc_pytorch.py did the trick. Works fine now

    – sigmoid
    Mar 11 at 9:15

















  • Since this is on the cluster, looks like the admin will have to do this right ?

    – sigmoid
    Mar 9 at 7:01











  • @sigmoid I guess not. I mean you still have a user there right? So it should be fine for you to download the pertained model in your home directory

    – Separius
    Mar 9 at 14:43











  • but the code and date is in a container....on the cluster

    – sigmoid
    Mar 9 at 16:07






  • 1





    thanks i will try that...wish i cud upvote you, but dont have enough rep

    – sigmoid
    Mar 10 at 3:01






  • 1





    TORCH_HOME=/mnt/test/torch export TORCH_HOME;cd /mnt/test;python imgc_pytorch.py did the trick. Works fine now

    – sigmoid
    Mar 11 at 9:15
















Since this is on the cluster, looks like the admin will have to do this right ?

– sigmoid
Mar 9 at 7:01





Since this is on the cluster, looks like the admin will have to do this right ?

– sigmoid
Mar 9 at 7:01













@sigmoid I guess not. I mean you still have a user there right? So it should be fine for you to download the pertained model in your home directory

– Separius
Mar 9 at 14:43





@sigmoid I guess not. I mean you still have a user there right? So it should be fine for you to download the pertained model in your home directory

– Separius
Mar 9 at 14:43













but the code and date is in a container....on the cluster

– sigmoid
Mar 9 at 16:07





but the code and date is in a container....on the cluster

– sigmoid
Mar 9 at 16:07




1




1





thanks i will try that...wish i cud upvote you, but dont have enough rep

– sigmoid
Mar 10 at 3:01





thanks i will try that...wish i cud upvote you, but dont have enough rep

– sigmoid
Mar 10 at 3:01




1




1





TORCH_HOME=/mnt/test/torch export TORCH_HOME;cd /mnt/test;python imgc_pytorch.py did the trick. Works fine now

– sigmoid
Mar 11 at 9:15





TORCH_HOME=/mnt/test/torch export TORCH_HOME;cd /mnt/test;python imgc_pytorch.py did the trick. Works fine now

– sigmoid
Mar 11 at 9:15



















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55073757%2fpytorch-permissionerror-errno-13-permission-denied-torch%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Can't initialize raids on a new ASUS Prime B360M-A motherboard2019 Community Moderator ElectionSimilar to RAID config yet more like mirroring solution?Can't get motherboard serial numberWhy does the BIOS entry point start with a WBINVD instruction?UEFI performance Asus Maximus V Extreme

Identity Server 4 is not redirecting to Angular app after login2019 Community Moderator ElectionIdentity Server 4 and dockerIdentityserver implicit flow unauthorized_clientIdentityServer Hybrid Flow - Access Token is null after user successful loginIdentity Server to MVC client : Page Redirect After loginLogin with Steam OpenId(oidc-client-js)Identity Server 4+.NET Core 2.0 + IdentityIdentityServer4 post-login redirect not working in Edge browserCall to IdentityServer4 generates System.NullReferenceException: Object reference not set to an instance of an objectIdentityServer4 without HTTPS not workingHow to get Authorization code from identity server without login form

2005 Ahvaz unrest Contents Background Causes Casualties Aftermath See also References Navigation menue"At Least 10 Are Killed by Bombs in Iran""Iran"Archived"Arab-Iranians in Iran to make April 15 'Day of Fury'"State of Mind, State of Order: Reactions to Ethnic Unrest in the Islamic Republic of Iran.10.1111/j.1754-9469.2008.00028.x"Iran hangs Arab separatists"Iran Overview from ArchivedConstitution of the Islamic Republic of Iran"Tehran puzzled by forged 'riots' letter""Iran and its minorities: Down in the second class""Iran: Handling Of Ahvaz Unrest Could End With Televised Confessions""Bombings Rock Iran Ahead of Election""Five die in Iran ethnic clashes""Iran: Need for restraint as anniversary of unrest in Khuzestan approaches"Archived"Iranian Sunni protesters killed in clashes with security forces"Archived