logo
down
shadow

What is my problem to use of Conv2D for image?


What is my problem to use of Conv2D for image?

Content Index :

What is my problem to use of Conv2D for image?
Tag : python-3.x , By : Frank Bradley
Date : January 12 2021, 01:40 AM

wish helps you First I read pictures from folders and sub-folders. Then I’m changing images to gray and resizing to 100*200. I want to classify my images to 6 class. When i want to create my model, I can't use Conv2D, cause I have dimension error but when I use Conv1D, I don’t have any error and neural network is work. I want to use conv2D because my data is image. What is my problem? , You need to add the channels dimension to your input training data:
import numpy as np

X_train = np.expand_dims(X_train, axis=3)
X_test = np.expand_Dims(X_test, axis=3)

Comments
No Comments Right Now !

Boards Message :
You Must Login Or Sign Up to Add Your Comments .

Share : facebook icon twitter icon

Difference between tf.layers.conv2d and tf.contrib.slim.conv2d


Tag : python , By : Tink
Date : March 29 2020, 07:55 AM
this will help I'm trying to convert a network that I'm using from using tf-slim's conv2d to using tf.layers.conv2d, since it looks like tf.layers is the more supported and future-proof option. The function signatures are fairly similar, but is there something algorithmically different between the two? I'm getting different output tensor dimensions than expected. ,
I'm getting different output tensor dimensions than expected.
x = tf.layers.conv2d(x, 256, 3, padding='same')

Tensorflow: why tf.nn.conv2d runs faster than tf.layers.conv2d?


Tag : python , By : quasarkitten
Date : March 29 2020, 07:55 AM
I hope this helps . If you try to follow the chain of function calls, you will find that tf.layers.conv2D() makes calls to tf.nn.conv2D() so no matter what you use, tf.nn.conv2d() will be called, it will be just faster if you call it yourself. You can use traceback.print_stack() method to verify that for yourself.
NOTE This does not mean that they are one and the same, select the function based on your need as there are various other tasks undertaken by tf.layers.conv2D().

Negative dimension size caused by subtracting 6 from 1 for 'conv1d_2/convolution/Conv2D' (op: 'Conv2D') with input shape


Tag : development , By : user90210
Date : March 29 2020, 07:55 AM
Does that help The error originates at the second Conv1D because your kernel is getting bigger than the tensor dimension. To fix this, either use padding='same' or change kernel_size=1 after the first Conv1D.

Assuming the order Conv2d->ReLU->BN, should the Conv2d layer have a bias parameter?


Tag : development , By : user106284
Date : March 29 2020, 07:55 AM
may help you . Yes, if the order is conv2d -> ReLU -> BatchNorm, then having a bias parameter in the convolution can help. To show that, let's assume that there is a bias in the convolution layer, and let's compare what happens with both of the orders you mention in the question. The idea is to see whether the bias is useful for each case.
Let's consider a single pixel from one of the convolution's output layers, and assume that x_1, ..., x_k are the corresponding inputs (in vectorised form) from the batch (batch size == k). We can write the convolution as
Wx+b #with W the convolution weights, b the bias
(Wx_i - mu)/sigma  ==> becomes (Wx_i + b - mu - b)/sigma i.e. no changes.
BN(ReLU(Wx+b))
(1/k)(0+...+0+ SUM_s (Wx_s+b))=some_term + b/k
const*((0-some_term-b/k)^2 + ... + (Wx_i+b - some_term -b/k)^2 +...)) 
(Wx_i+b - some_term - b/k)^2 = some_other_term + some_factor * W * b/k * x_i

ValueError: Dimensions must be equal, but are 1 and 3 for 'Conv2D' (op: 'Conv2D') with input shapes: [1,400,400,1], [1,3


Tag : python , By : WuJanJai
Date : March 29 2020, 07:55 AM
Related Posts Related QUESTIONS :
  • Concatenation of Lambda functions in Python 3
  • When Scraping got html with "encoded" part, is it possible to get it
  • Factor Analysis using Python Factor_Analyzer
  • opening csv file in a numpy.txt in python3
  • i tried installing tensorflow using 'pip install tensorflow ' in anaconda prompt and command prompt. its showing followi
  • Keras EarlyStopping is not recognized
  • Parallel processes overwriting progress bars (tqdm)
  • Even though strings in python are immutable how is that sort or sorted function works on it?
  • How to apply default value to python dataclass field when None was passed?
  • How to Fix Labels and Entries Inside Tab
  • Flask container is not up and running using docker
  • How can I import thread package in Python 3?
  • Extract text from .txt file and save into .csv files with columns and header
  • Structuring Google Cloud Platform project
  • Problem playing audio with playsound on python3
  • Problem while reading public key from .pem certificate into a variable in Python
  • ipysheet and dataframe. How modify value in a ipysheet when a checkbox is checked
  • How to check list in list with another list
  • Counting white clusters horizontally in a processed fabric
  • What is the best practice to set parameter as dictionary type as default value in python
  • Retraining pre-trained word embeddings in Python using Gensim
  • Finding corresponding rectangle coordinates given grid points
  • Understanding the mathematical expression of cost function
  • How do you change the color of specified pixels in an image?
  • Dynamic DAG Creation Not working as expected in Apache airflow
  • How to use numpy arrays of strings in python 3?
  • Dataframe pandas split str
  • ImportError: cannot import name 'MultiOutputMixin' from 'sklearn.base'
  • Binary digits: what does '-0b1' represent?
  • How can I escape fields in a f-string?
  • Why is my detection score high inspite of obvious misclassifications during prediction?
  • ModuleNotFoundError: No module named 'tensorrt'
  • can you help me resolve the error "can't assign to function call"?
  • How to understand this simultaneous assignment evaluation in python 3?
  • It the any proper way how to take a two byte elemetns from list, concat them, and convert them to integer
  • IndexError: invalid index of a 0-dim tensor. Use tensor.item() to convert a 0-dim tensor to a Python number
  • Scraping 'next' page after finishing in the main one using Rules
  • Add custom headers to SOAP request using zeep.Client Python
  • Only One Pod is consuming all the computing resource although specified the limits and requests resources in pod templat
  • Inheritance of modules in Python?
  • ModuleNotFoundError: No module named 'frontend'
  • How to fetch all data of solr which contains 40k rows into csv?
  • Validating phone numbers in python using RE
  • pd.DataFrame: adding values in specific locations
  • How to take all combination of a pandas dataframe (choosing 2 at a time) and make a new dataframe with each two combinat
  • Connecting the missing pixels
  • Returns Nothing [] from Google + API using Python
  • Accesing "Next" page with scrapy rules
  • no module named "tensorflow.python.platform" when importing tensorflow || tflearn on python shell
  • Issue with appending to an array
  • Is there a way to add a column to a geopandas dataframe using a single value geoseries?
  • How do I add elements of a set and print their sum?
  • Pandas read_csv from FileStorage in Flask
  • docker build: Returned a non-zero code: 5
  • Covert a dataframe into a matrix form
  • i am webscraping with bs4 and the urls wont show up
  • How to fix ModuleNotFoundError: No module named 'pip._internal' with python source code installation
  • Pytorch RuntimeError: Expected tensor for argument #1 'indices' to have scalar type Long; but got CUDAType instead
  • How to convert month name to month number in a timeseries in DataFrame?
  • Why does pandas.where() returning 'None'
  • shadow
    Privacy Policy - Terms - Contact Us © scrbit.com