-
Notifications
You must be signed in to change notification settings - Fork 537
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
About image shape debug #98
Comments
def datagenerator(data_dir='data/Train400', batch_size=128, verbose=False):
I think now it will run okay.. |
Batch Size and discard_n: The discard_n value is calculated to remove any remaining data points that don't fit into full batches. However, it seems like you're using a variable batch_size that is not defined within this function. Make sure you pass the correct batch size to the function or define it within the function. Data Shape: You reshape the data array at the end of the function using data.reshape((data.shape[0]*data.shape[1],data.shape[2],data.shape[3],1)). This assumes that the patches generated for each image are of the same shape. If your images have varying shapes after patch extraction, this reshape operation might not work as intended. You'll need to handle this based on the specific shapes of the patches you've generated. Return Value: The function currently returns the variable data, which is an array containing all the generated patches. If this is your intended behavior, then the function is fine. However, if you want to return patches for each image separately, you might need to modify the structure of your returned data. |
I used my own dataset with an image size of 1536 * 2048, but an error was reported as follows: (ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 2 dimensions. The detected shape was (12, 88185) + inhomogeneous part.) How to debug? Thanks!!!
The text was updated successfully, but these errors were encountered: