tensorflow

Keras NN regression model gives low loss, and 0 acuracy

邮差的信 提交于 2021-02-05 12:22:19
问题 I am having a problem with this NN regression model in keras. I am working on a cars dataset to predict the price based on 13 dimensions. In short, I have read it as pandas dataframe, converted numeric values to float, scaled the values, and then used one-hot encoding for categorical values, which has created a lot of new columns, but that does not concern me much at this point. What concerns me is that the accuracy is practically 0%, and I cannot figure out why. Dataset can be found here:

How to create a layer to invert a softmax (TensforFlow,python)?

笑着哭i 提交于 2021-02-05 12:09:37
问题 I am building a deconvolution network. I would like to add a layer to it which is the reverse of a softmax. I tried to write a basic python function that returns the inverse of a softmax for a given matrix and put that in a tensorflow Lambda and add it to my model. I have no error but when I doing a predict I only have 0 at the exit. When I don't add this layer to my network I have output something other than zeros. This therefore justifies that they are due to my inv_softmax function which

How to create a layer to invert a softmax (TensforFlow,python)?

£可爱£侵袭症+ 提交于 2021-02-05 12:08:30
问题 I am building a deconvolution network. I would like to add a layer to it which is the reverse of a softmax. I tried to write a basic python function that returns the inverse of a softmax for a given matrix and put that in a tensorflow Lambda and add it to my model. I have no error but when I doing a predict I only have 0 at the exit. When I don't add this layer to my network I have output something other than zeros. This therefore justifies that they are due to my inv_softmax function which

How to create a layer to invert a softmax (TensforFlow,python)?

谁都会走 提交于 2021-02-05 12:08:26
问题 I am building a deconvolution network. I would like to add a layer to it which is the reverse of a softmax. I tried to write a basic python function that returns the inverse of a softmax for a given matrix and put that in a tensorflow Lambda and add it to my model. I have no error but when I doing a predict I only have 0 at the exit. When I don't add this layer to my network I have output something other than zeros. This therefore justifies that they are due to my inv_softmax function which

How can we build a ROC curve for customized ANN Model on Python?

∥☆過路亽.° 提交于 2021-02-05 12:01:14
问题 I am trying to build a customized ANN Model on Python. My method, where I have built the model, is as follows: def binary_class(x_train,nodes,activation,n): #Creating customized ANN Model model=Sequential() for i in range(len(nodes)): if(i==0): if(activation=='sigmoid'): model.add(Dense(units = nodes[i], kernel_initializer = 'glorot_uniform',activation='sigmoid',input_dim = len(x_train[1]))) if(activation=='relu'): model.add(Dense(units = nodes[i], kernel_initializer = 'he_uniform',activation

Numpy load with `allow_pickle=true` old `keras` in `tensorflow.keras`

落爺英雄遲暮 提交于 2021-02-05 10:47:41
问题 Numpy load with allow_pickle=true old keras in tensorflow.keras Situation I have taken a course, where a Jupyter-notebook with a few example use-cases was provided. In order to save time and to have a clean working-environment, I've decided to use the Docker-image: jupyter/tensorflow-notebook:latest (see here). These are the pip list results for the relevant modules: [...] Keras-Applications 1.0.8 Keras-Preprocessing 1.1.0 [...] numpy 1.17.5 [...] tensorflow 2.1.0 [...] (a) The following

Can't install tensorflow on windows 7 32-bit

▼魔方 西西 提交于 2021-02-05 10:45:08
问题 I can't install TensorFlow in Windows 7, Python 3(32-bit, Lenovo ThinkPad X201s). When I type pip3 install tensorflow : Microsoft Windows [Version 6.1.7601] Copyright (c) 2009 Microsoft Corporation. All rights reserved. C:\Users\sjkim>pip3 install tensorflow Collecting tensorflow Could not find a version that satisfies the requirement tensorflow (from versions: ) No matching distribution found for tensorflow C:\Users\sjkim> And I also have 2 python versions. How can I install it? 回答1:

InvalidArgumentError: Input to reshape is a tensor with 27000 values, but the requested shape has 810000 [Op:Reshape]

半城伤御伤魂 提交于 2021-02-05 10:42:07
问题 Getting the following error message when setting up a 3D-GAN for ModelNet10: InvalidArgumentError: Input to reshape is a tensor with 27000 values, but the requested shape has 810000 [Op:Reshape] In my opinion the batch is not properly created and thereby the shape of the tensor is not valid. Tried different things but can´t get the batch set up.. I am more than thankful for any hints how to clean up my code! Thanks in advance! import time import numpy as np import tensorflow as tf np.random

How to avoid OOM errors in repeated training and prediction in TensorFlow?

好久不见. 提交于 2021-02-05 09:39:58
问题 I have some code in TensorFlow which takes a base model, fine-tunes (trains) it with some data, and then uses the model to predict() using some other data. All this is encapsulated in a main() method of a module and works fine. When I run this code in a loop over different base models, however, I end up with an OOM after, e.g., 7 base models. Is this expected? I would expect that Python cleans up after each main() call. Does TensorFlow not do that? How can I force it to? Edit: here's an MWE

How to avoid OOM errors in repeated training and prediction in TensorFlow?

梦想与她 提交于 2021-02-05 09:39:07
问题 I have some code in TensorFlow which takes a base model, fine-tunes (trains) it with some data, and then uses the model to predict() using some other data. All this is encapsulated in a main() method of a module and works fine. When I run this code in a loop over different base models, however, I end up with an OOM after, e.g., 7 base models. Is this expected? I would expect that Python cleans up after each main() call. Does TensorFlow not do that? How can I force it to? Edit: here's an MWE