Transfer .dat files from AWS instance to local machine

Hi, I have a trained model on my EC2 instance and i’ve saved the predictions we get on running model_name.test, which basically is the output of model.predict_generator(), over the test data as preds.dat.
Now if i want to transfer this to my local machine from AWS, how am i to go about that?
I tried using scp but it gives me the following error:
scp: /home/ubuntu/nbs/Notebooks/Weights/Predictions/preds.dat: not a regular file

Can someone tell me how to transfer it?
Another option i see is to use a different extension other than dat but i’m not sure which one would work.

EDIT: The scp command used:

scp -i .ssh/aws-key-fast-ai.pem ~/test_preds_rms.dat

It worked perfectly for .csv .h5 and .ipynb files just gave error on .dat files

Thanks in advance

What was the scp command you gave? Can you paste it here?

Just added that above! :slight_smile:

Do you have a local version of test_preds_rms.dat on your system?

You do not need to specify the destination filename. Just do this:

scp -i .ssh/aws-key-fast-ai.pem ~/

Let me know if this helps.

I tried that, it didn’t work.

Strange. It works on my machine (transferring a .dat file).

Maybe you’re entering the filepath wrong? Is the .dat a file or folder on your AWS?
Can you also share a screenshot of the folder layout on AWS?

Thanks it worked. I did a very stupid mistake. Since the extension was .dat i thought it was a file but it was infact a folder. So you have to use -r with scp in order to add a folder. Worked when i did that. Thanks again!

1 Like