Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A problem with stitched tiles and generate #66

Closed
Narjes97 opened this issue Apr 29, 2024 · 12 comments
Closed

A problem with stitched tiles and generate #66

Narjes97 opened this issue Apr 29, 2024 · 12 comments

Comments

@Narjes97
Copy link

Hi,

I am trying to use this tool for Rhode Island to get its network. I am using the 2020 Spring Rhode Island Digital Orthophotographs for this purpose and am using "Generate XYZ Tiles (Directory)" for converting the tiff file to 256*256 png files. I have considered a small area in Rhode Island as a location first. After running the code, although the code gives me a directory of stitched tiles, it is empty, and I cannot understand why. I think this is the reason that I get an error while running "generate". Could you please help me with this issue?

Screenshot from 2024-04-29 15-37-42

Screenshot from 2024-04-29 15-42-30

Screenshot from 2024-04-29 15-45-14

@Mary-h86
Copy link
Member

Mary-h86 commented Apr 29, 2024

@Narjes97
Thank you for using Tile2Net.
From what I see of your path, seems like your zoom level should be 19 and you are passing 20, if that is the case, then the tool cannot find the x and y of tile associated with zoom level 20 and it is throwing the error. The error is not related to the stitching part of the process, the tool first checks your input folder to make sure the tiles are correct and correspond to the area and zoom level you specified and then stitch them together.
Change the zoom argument to be 19 instead and run again.

Let me know if that solves the problem.

@Narjes97
Copy link
Author

I have changed the zoom level to 19, but the problem still exists. There is no folder named "256_19_1" when I run the raster.project.tiles.stitched command. I still get error while running generate.

Screenshot from 2024-04-29 20-18-20

Screenshot from 2024-04-29 20-21-17

Screenshot from 2024-04-29 20-22-00

@Mary-h86
Copy link
Member

Mary-h86 commented Apr 30, 2024

@Narjes97
I am not quite sure what you want to do here, but, it seems to me that you are trying to run the example (the location lat long is from within Boston Common). I don't see Rhode Island coordinates passed to your Raster object.

If you want to run the example, it means that you are running for an area that we support, which is in Massachusetts and you don't need to pass an input_dir for it since the tool automatically downloads and stitches the tiles for you.
No input_dir argument is required.

But if you are trying to see how passing input_dir works, and you have your own tiles for the same area of Boston, can you run the tree command for me (if you are using Linux) from the `./static' folder? If not using linux, run this:

import os
os.listdir("./static/ma/19")

and paste the results here?

@Narjes97
Copy link
Author

Narjes97 commented May 5, 2024

Hi,
Sorry for the misunderstanding. I want to run the tile2net tool on Rhode Island to get its network. I had the tiff file of this area and I used "Generate XYZ Tiles (Directory)" tool in qgis for converting the tiff file to 256256 png files and I did it foe zoom = 16. At first, I gave a small bounding box in Rhode Island as the location. Also, I gave the folder of 256256 png files as my input. But it seems that the tool does not use my input at all. because when I make the input line as comment, the code still finds tiles. Here, I have attached the screenshots:

Screenshot from 2024-05-05 18-06-15

Screenshot from 2024-05-05 18-06-56

Then, I just gave rhode_island as my location with no bounding box and the code finds tiles without using my input:

Screenshot from 2024-05-05 18-09-00

I am not sure what is really going on :) for all these cases, I still get the previous error in generate and also there are no stitched tiles in the directory. These are the screenshots of these steps:

Screenshot from 2024-05-05 18-11-13

Screenshot from 2024-05-05 18-11-57

Screenshot from 2024-05-05 18-12-16

@Mary-h86
Copy link
Member

Mary-h86 commented May 5, 2024

@Narjes97
There are a few arguments that are not passed correctly in your code. But before getting into those details, since you used QGIS for tiling your region, by default, the path structure for your tiles should be like: ./Rhode_Island/16/x/y.png , the input_dir you entered does not match that pattern.
To confirm, as I requested before, could you please either run the tree command from inside your ./Rhode_Island directory in Linux terminal or paste the absolute path to one of your tile files that you created using QGIS.

@Narjes97
Copy link
Author

Narjes97 commented May 7, 2024

The tree command does not work on my Linux terminal. It is an Alienware and for installing a tree, it needs some permission that I cannot access. But I used the other command you suggested:

Screenshot from 2024-05-06 23-05-08

Also, I was able to run generate command:

Screenshot from 2024-05-06 23-05-31

But now I get an error while running the inference command:

Screenshot from 2024-05-06 23-06-11
Screenshot from 2024-05-06 23-06-28
Screenshot from 2024-05-06 23-06-42

Could you please help me with this step as well?

@Narjes97
Copy link
Author

Hi,

I just wanted to make sure you have received my previous comment since I have not heard from you :)

@Mary-h86
Copy link
Member

@Narjes97
Hi Narjes, yes we have received it but our team has been pretty busy with various deadlines the past few weeks. I will try to get back to you by the end of the week!

@Mary-h86
Copy link
Member

@Narjes97
Your GPU is not being recognized and the process is running on CPU instead.

can you run

Import torch 
print(torch.cuda.is_available())
print(torch.cuda.device_count()) 
print(torch.cuda.current_device())

Can you use a terminal window instead of the Jupyter notebook and run nvidia-smi?

Send me the outputs of these so I can better assist you.

@Narjes97
Copy link
Author

Screenshot from 2024-05-19 18-04-13

Screenshot from 2024-05-19 18-06-23

@Mary-h86
Copy link
Member

Mary-h86 commented May 19, 2024

Yes. So as I expected, the problem is related to your GPU settings, torch cannot access it and the output you got from nvidia-smi can typically mean there is a conflict between the NVIDIA driver and the NVML (NVIDIA Management Library) versions installed on your system.
This is not a Tile2Net related issue and unfortunately, I cannot help that much with it. To be able to use your GPU, You need to resolve this issue, and make sure that you get a correct output from nvidia-smi, as well as the torch commands I sent before. The first one should return True and then you will get the number of available GPUs and the index of your currently selected GPU.
When you run nvidia-smi outside the environment, do you get a correct output?

@Mary-h86
Copy link
Member

Mary-h86 commented Jun 6, 2024

I am closing this issue. Feel free to re-open if you have any other questions.

@Mary-h86 Mary-h86 closed this as completed Jun 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants