Hi guys, I am currently following tutorial <https:...
# ask-the-community
j
Hi guys, I am currently following tutorial https://docs.flyte.org/projects/cookbook/en/stable/auto/integrations/flytekit_plugins/onnx_examples/pytorch_onnx.html However, when I want to save image to my current directory by changing to code to
Copy code
final_img = Image.merge(
        "YCbCr",
        [
            img_out_y,
            img_cb.resize(img_out_y.size, Image.BICUBIC),
            img_cr.resize(img_out_y.size, Image.BICUBIC),
        ],
    ).convert("RGB")

    img_path = (
        Path("cat_superres_with_ort.jpg")
    )
    final_img.save(img_path)
Where can I find cat_superres_with_ort.jpg? Thanks!
s
@Jun Kwan, the code in docs saves the image to that file. If you want to save the image to your current directory, just write
img_path = "cat_superres_with_ort.jpg"
.
j
@Samhita Alla thanks for your reply, when I open my current directory, I don't see the jpg file, is it because it is stored within the docker container but not in my local disk?
s
How are you running the code?
j
Copy code
flytectl sandbox start --source .
flytectl sandbox exec -- docker build . --tag "my_flyte_project:v1"
pyflyte --pkgs example package --image "my_flyte_project:v1"
flytectl register files --project flytesnacks --domain development --archive flyte-package.tgz --version v1
pyflyte run --remote example.py wf --image "my_flyte_project:v1"
@Samhita Alla I was trying to deploy to my local server
everything is fine, just wanna know where does the docker store
cat_superres_with_ort.jpg
s
Have you checked in the docker container?
Also since that file is being returned as a FlyteFile, you can download it directly. On the console, you should see a s3 uri that you can download.
j
Oh yea, i guess i am not too sure how do i download using s3 uri
Do you have a guide for that? @Samhita Alla
s
Go to http://localhost:30088 (creds: minio & miniostorage), follow the bucket path and download the file (there should be a download button available).
j
@Samhita Alla problem solved, thanks!
@Samhita Alla just wondering why is the file not saved to my local disk?
s
Since you’re running the code on docker container, it won’t be saved in your current directory. The file should be available in the docker container, though.
j
@Samhita Alla is there any way to make it save in the local disk? i always run pyflyte --remote options
s
I don’t think you can do that. May I know why you want to save the file in your local directory?
j
Just wanna open and check the file whenever I save a file in a container. Now the extra step is to go to localhost:30088 to check the output file, but i guess that's fine too. Thanks for your help! @Samhita Alla
s
Um gotcha. You can run the code locally without the --remote option in case you want to test it multiple times and view the file after every run.
j
@Samhita Alla yea that works perfectly fine, but I wouldnt be able to use the console if I run it without the --remote option
156 Views