text stringlengths 81 47k | source stringlengths 59 147 |
|---|---|
Question: <p>I'm using, on a Windows 11 Pro PC, Python 3.11 and I'm trying to import Tenserflow and Keras for this test program:</p>
<pre><code>from sklearn.datasets import load_breast_cancer
from sklearn.model_selection import train_test_split
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers... | https://stackoverflow.com/questions/76828324/keras-2-13-1-on-windows-modulenotfounderror-no-module-named-tensorflow-keras |
Question: <p>I dont understand these errors im getting can someone please explain it to me?</p>
<p>'''
Traceback (most recent call last):
File "C:\Users\pacym\DRL_AERIATIONBASIN\pythonProject1\SQL.py", line 4, in
import tensorflow as tf
File "C:\Users\pacym\DRL_AERIATIONBASIN\pythonProject1.venv\Lib\sit... | https://stackoverflow.com/questions/78222729/python-tenserflow-chatgpts-gymnasiam-for-deep-reinforcement-learning-errors |
Question: <p>I've been using <a href="https://www.tensorflow.org/tutorials/generative/style_transfer#calculate_style" rel="nofollow noreferrer">this</a> tutorial from TensorFlow's site to create a <a href="https://gist.github.com/daniel-keller/1d36b4e225b161cc375a3c26d27e0be6" rel="nofollow noreferrer">script</a> (pyth... | https://stackoverflow.com/questions/64921166/tenserflow-how-to-save-style-transfer-model-for-later-use |
Question: <p>If I use tenserflow 1.8 or tensorflow 1.12, which version of tf-version I can use for inference?
Is it have a requirement that if I use tenserflow 1.8 then I should choose corresponding tf-serving r1.8?
Or we just use the master branch is ok?</p>
Answer: <p>Yes, it's best to use the version of TF Serving ... | https://stackoverflow.com/questions/54489735/how-to-select-a-tf-serving-version |
Question: <pre><code> Exception:
Traceback (most recent call last):
File "c:\program files\python36\lib\site-packages\pip\basecommand.py", line 215, in main
status = self.run(options, args)
File "c:\program files\python36\lib\site-packages\pip\commands\install.py", line 342, in run
prefix=options.prefix_p... | https://stackoverflow.com/questions/48880649/how-to-get-rid-from-this-error-while-downloading-tensorflow |
Question: <pre><code>final List<ObjectionDetector.Recognition> mappedRecognitions = new LinkedList<>();
for (final ObjectionDetector.Recognition result : results)
{
final RectF location = result.getLocation();
}
</code></pre>
Answer: | https://stackoverflow.com/questions/60408106/calculate-object-distance-from-camera-with-tenserflow-in-android |
Question: <pre><code>from keras_efficientnets import EfficientNetB0
AttributeError: module 'keras.utils.generic_utils' has no attribute 'populate_dict_with_module_objects'
</code></pre>
<p>I installed keras-efficientnets, I installed tenserflow, but it is showing error while importing.</p>
Answer: | https://stackoverflow.com/questions/68013868/i-am-not-able-to-importing-keras-efficientnet-b0-even-i-installed-keras-efficien |
Question: <pre><code>!python {SCRIPTS_PATH + '/generate_tfrecord.py'} -x {IMAGE_PATH + '/train'} -l {ANNOTATION_PATH + '/label_map.pbtxt'} -o {ANNOTATION_PATH + '/train.record'}
!python {SCRIPTS_PATH + '/generate_tfrecord.py'} -x{IMAGE_PATH + '/test'} -l {ANNOTATION_PATH + '/label_map.pbtxt'} -o {ANNOTATION_PATH + '/te... | https://stackoverflow.com/questions/70933750/spyder-modulenotfounderror-no-module-named-object-detection |
Question: <p>I have some experience in Tenserflow but I'm new to pytorch. Sometimes I need more than 1 metric to check the accuracy of training. In Tenserflow, I used to do as shown below. But I wonder how could list more than 1 metric in pytorch.</p>
<pre><code>LR = 0.0001
optim = keras.optimizers.Adam(LR)
dice_loss_... | https://stackoverflow.com/questions/71404067/using-more-than-1-metric-in-pytorch |
Question: <p>I am trying to install Tenserflow through <a href="https://docs.conda.io/en/latest/" rel="nofollow noreferrer">Conda</a>. When I run:</p>
<p><code>pip install --upgrade tensorflow</code></p>
<p>I get the following error:</p>
<pre><code>Collecting tensorflow
Downloading tensorflow-2.2.0-cp36-cp36m-win_amd... | https://stackoverflow.com/questions/62879867/tensorflow-installation-error-in-conda-environment |
Question: <p><strong>Trying to install TensorFlow</strong> </p>
<p><strong>Installing with native pip</strong></p>
<p><em>Error:</em></p>
<pre><code>C:\Users\Sourav>pip3 install --upgrade tensorflow
Collecting tensorflow
Could not find a version that satisfies the requirement tensorflow (from versions: )
No mat... | https://stackoverflow.com/questions/44189048/couldnt-install-tenserflow-on-windows10-with-python-version-3-5-3-64-bit |
Question: <p>I have a large dataset of numpy integers which I want to analyze with a GPU. The dataset is too large to fit into main memory on the GPU so I am trying to serialize them into a TFRecord and then use the API to stream the record for processing. The below code is example code: it wants to create some fake da... | https://stackoverflow.com/questions/49633220/serialized-data-doesnt-match-deserialized-data-in-tenserflow-tfrecorddataset-co |
Question: <p>I have data that contains a boolean feature (X),
Is there is any way to make the samples that contain x=1 more important than other samples?</p>
<p>NB1: By <strong>make certain training samples more important</strong> I mean these samples can affect the model more than other samples. I've already read some... | https://stackoverflow.com/questions/69411841/how-to-make-certain-training-samples-more-important-in-keras-tenserflow |
Question: <p>Hey I am new to Tenserflow, I got the tenserflow code from git (<a href="https://github.com/tensorflow/serving" rel="nofollow noreferrer">https://github.com/tensorflow/serving</a>) and when i tried to build it-using the steps in the documentation-I was getting this error:</p>
<blockquote>
<p>ERROR:
co... | https://stackoverflow.com/questions/42694991/tensorflow-build-error |
Question: <p>while importing tenserflow module in anaconda notebook I'm facing this error numpy.core.multiarray failed to import</p>
Answer: <p>Welcome to StackOverflow.
Please consider <a href="https://stackoverflow.com/help/how-to-ask">reviewing "How do i ask a good question" guidelines</a> to provide more context.... | https://stackoverflow.com/questions/57913519/import-tensorflow-as-tf-error-occur-in-anaconda-navigator |
Question: <p>I was working on my app, and was trying to figure out how to get my model to output a result in my react native app.</p>
<p>In the app there is a page which prompts the user to take a photo, and from that image the model is supposed to print out the result on the next page after the user presses the button... | https://stackoverflow.com/questions/77991441/how-to-implement-a-tenserflow-models-prediction-in-a-react-native-app-page |
Question: <p>I have tried installing tenserflow in my ubuntu os but i get error as no module what may be the problem !! </p>
<p>My code :</p>
<pre><code>import tensorflow.contrib.learn as learn
from sklearn import datasets, metrics
iris = datasets.load_iris()
feature_columns = learn.infer_real_valued_columns_from_in... | https://stackoverflow.com/questions/41054895/no-module-named-tensorflow-contrib-learn |
Question: <p>I am trying to run my model but i am running intro an error</p>
<pre><code>2021-06-03 01:20:42.015864: W tensorflow/core/common_runtime/bfc_allocator.cc:467] **************************************************************************__________________________
2021-06-03 01:20:42.015984: W tensorflow/core/fr... | https://stackoverflow.com/questions/67813249/why-does-my-model-which-uses-tenserflow-and-keras-gpu-oom-error |
Question: <p>I executed the command <code>pip install tensorflow</code> .
But the installation is giving me following error. Below is the part of log</p>
<pre><code>ERROR: After October 2020 you may experience errors when installing or updating packages. This is because pip will change the way that it resolves dependen... | https://stackoverflow.com/questions/64650802/how-to-resolve-error-in-tenserflow-installation-caused-by-other-packages-version |
Question: <p>When I am executing the following command to train model using tenserflow, I got below errors.</p>
<p><strong>Command</strong> :</p>
<pre><code>python legacy/train.py --logtostderr --train_dir=training/ --pipeline_config_path=training/faster_rcnn_inception_v2_pets.config
</code></pre>
<p><strong>Errors</st... | https://stackoverflow.com/questions/64035274/train-object-detection-module-using-tensorflow |
Question: <p>heres the code:</p>
<pre><code>encode_train = sorted(set(img_name_vector))
image_dataset = tf.data.Dataset.from_tensor_slices(encode_train)
image_dataset = image_dataset.map(load_image, num_parallel_calls=tf.data.experimental.AUTOTUNE).batch(64)
%%time
for img, path in tqdm(image_dataset):
batch_feature... | https://stackoverflow.com/questions/72760437/unknown-image-file-format-one-of-jpeg-png-gif-bmp-required-node-decodej |
Question: <p>I have <code>conv1 = nn.Conv2d(3, 16, 3,stride= 2, padding = 1, bias=True, groups=1)</code> . i need its corresponding api in <code>tf.keras.layers.Conv2D</code>.</p>
<p>Can anyone help me out</p>
<p>PS : Here i have a stride of <code>2</code></p>
Answer: <p>I have found the solution , hope this might be ... | https://stackoverflow.com/questions/71979310/pytorch-equivalent-of-conv2d-in-tenserflow-with-stride-of-2-and-padding-of-1-1 |
Question: <p>How can I disable tenserflow information output in the console
Tried changing Environment "TF_CPP_MIN_LOG_LEVEL" to 3
After looking at the answers on the Internet, I found only Python</p>
<pre><code>2022-10-20 22:31:27.972310: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x22ca26... | https://stackoverflow.com/questions/74144000/tensorflow-net-disable-log-information |
Question: <p>In firebase cloud function I'm trying to run a tenserflow model. But I keep getting the error: tf.node.loadLayersModel is not a function. Does anyone know what I might do wrong?</p>
<pre><code>exports.runPredictionOnUpload = functions.firestore
.document('modeltest/{docId}')
.onCreate(async (snap, ... | https://stackoverflow.com/questions/79063388/firebase-cloud-function-error-loading-tensorflow-model-tf-node-loadlayersmode |
Question: <p>I am trying to understand TenserFlow image classification. Got following <a href="https://github.com/shivakrishna9/tensorflow-retrain" rel="nofollow noreferrer">code</a> from GitHub, starts from 298 line in "retrain.py" script.</p>
<pre><code>dest_directory = FLAGS.model_dir
if not os.path.exists(dest_dir... | https://stackoverflow.com/questions/47959726/what-does-dest-directory-flags-model-dir-mean |
Question: <p>I am trying to feed data for multiple inputs (2 inputs) for Keras (Tenserflow) for TPU training, but I get this error:</p>
<pre><code>ValueError: The dataset returned a non-Tensor type
((<class 'tensorflow.python.framework.ops.Tensor'>,
<class 'tensorflow.python.framework.ops.Tensor'>)) ... | https://stackoverflow.com/questions/55750998/how-to-feed-data-for-tensorflow-for-multiple-inputs-for-tpu |
Question: <p>Here is my file:</p>
<p>vim hello.py</p>
<pre><code>from sklearn.preprocessing import PolynomialFeatures
from sklearn import linear_model
X = [[0.44, 0.68], [0.99, 0.23]]
vector = [109.85, 155.72]
predict= [0.49, 0.18]
poly = PolynomialFeatures(degree=2)
X_ = poly.fit_transform(X)
predict_ = poly.fit_t... | https://stackoverflow.com/questions/51573503/tensorflow-error-script |
Question: <p>I searched alot but not found how to use model of sklearn in android .Yes simple model like find possibilities we can convert it into json and then can use via api in android but when we deal with live videos then what??</p>
<p>And also my second doubt is " can we use sklearn and tenserflow both in on... | https://stackoverflow.com/questions/71586009/is-there-any-way-to-use-sklearn-complex-model-in-android |
Question: <p><a href="https://i.sstatic.net/aCqu6.png" rel="nofollow noreferrer">I tried running this command but i get erros that i dont have tenserflow 2.2 or higher. But I checked and I have the correct version of tenserflow. I also did pip3 install keras command </a>
I know for a fact that all of the code is correc... | https://stackoverflow.com/questions/64384038/i-am-doing-docker-jupyter-deep-learning-course-and-ran-in-to-a-problem-with-impo |
Question: <p>I have a questions about <a href="https://github.com/tensorflow/tensorflow/tree/master/tensorflow/examples/android/" rel="nofollow noreferrer">TensorFlow Android Camera Demo</a>, first of all, to start work with this demo I should download (clone) in my laptop all <a href="https://github.com/tensorflow/ten... | https://stackoverflow.com/questions/40498899/tensorflow-android-camera-demo |
Question: <p>Hi I'm trying to test tenserflow video classification tutorial. Here is the <a href="https://github.com/tensorflow/examples/tree/master/lite/examples/video_classification/raspberry_pi" rel="nofollow noreferrer">link</a>. After all the dependancies installation, I got issue <a href="https://i.sstatic.net/5R... | https://stackoverflow.com/questions/76521316/how-to-resolve-importerror-lib-arm-linux-gnueabihf-libstdc-so-6-version-g |
Question: <p>Long story short I have this problem where when I run the code it says that the module I use Tensorflow has no attribute 'merge_summary' The thing is that I don't even use merge_summary.</p>
<p>I have tried to uninstall tenserflow and it didn't work.</p>
<pre class="lang-py prettyprint-override"><code>im... | https://stackoverflow.com/questions/58207780/module-tensorflow-has-no-attribute-merge-summary-error |
Question: <p>I know Quadro 2000 is CUDA 2.1.
My PC specs as follows:</p>
<ul>
<li>Quadro 2000 with 16GB RAM.</li>
<li>Xeon(R) CPU W3520 @2.67GHz 2.66GHz</li>
<li>Windows 10Pro. </li>
</ul>
<p>I want to use <strong>Tenserflow</strong> for Machine Learning, and Deep Learning.</p>
<p>Let me know a little in-depth, a... | https://stackoverflow.com/questions/60108403/i-have-a-nvidia-quadro-2000-graphic-card-and-i-want-to-install-tensorflow-will |
Question: <p>I am trying to create a network with tenserflow and BigBird.</p>
<pre><code>from transformers import BigBirdModel
import tensorflow as tf
classic_model = BigBirdModel.from_pretrained('google/bigbird-roberta-base')
input_ids = tf.keras.layers.Input(shape=(LEN, ), dtype='int64', name='input_ids')
outputs =... | https://stackoverflow.com/questions/67942218/how-to-use-bigbirdmodel-to-create-a-neural-network-in-python |
Question: <p>I want to convert Keras saved model to saved_model which can be using with Tenserflow serving</p>
<p>I create model using pretrained model</p>
<pre><code>feature_extractor_url = "https://tfhub.dev/google/tf2-preview/inception_v3/feature_vector/4"
feature_extractor_layer = hub.KerasLayer(feature_extractor... | https://stackoverflow.com/questions/59826281/tf-saved-model-simple-save-fail-when-converting-from-keras-model |
Question: <p>I'm using the Mask RCNN library which is based on tenserflow and I can't seem to get it to run on my GPU (1080TI). The inference time is 4-5 seconds, during which I see a usage spike on my cpu but not my gpu. Any possible fixes for this?</p>
Answer: <p>It is either because that GPU_COUNT is set to 0 in <c... | https://stackoverflow.com/questions/55211277/mask-rcnn-uses-cpu-instead-of-gpu |
Question: <p>I'm trying to train the mnist database with the neural network after applying PCA. and I keep getting errors because of the data shape after applying the PCA. I'm not sure how to fit everything together. and how to go through the whole database, not just a small patch.</p>
<p>here is my code:</p>
<pre><c... | https://stackoverflow.com/questions/53464139/im-pca-with-deep-neural-network-using-tenserflow-with-mnist-database-getting-e |
Question: <p>I try to train ResNet 50 for Image classification using this code: <a href="https://github.com/mlperf/training/blob/master/image_classification/tensorflow/official/resnet/imagenet_main.py" rel="nofollow noreferrer">https://github.com/mlperf/training/blob/master/image_classification/tensorflow/official/resn... | https://stackoverflow.com/questions/60397094/image-classification-using-resnet-50 |
Question: <p>now I'm studying about tensorflow with jupyter notebook.</p>
<p>But, I have a problem.</p>
<p>my code like this!</p>
<pre><code>sess = tf.compat.v1.Session()
print("sess.run(node1, node2): ", sess.run([node1, node2]))
print("sess.run(node3): ", sess.run(node3))
</code></pre>
<p>error o... | https://stackoverflow.com/questions/66599444/tensorflow-error-tensor-graph-is-meaningless-when-eager-execution-is-enabled |
Question: <p>Code:</p>
<pre><code>weights1 = tf.get_variable("weights1",shape=[12,80],initializer = tf.contrib.layers.xavier_initializer())
biases1 = tf.get_variable("biases1",shape = [80],initializer = tf.zeros_initializer)
layer1out = tf.nn.relu(tf.matmul(X,weights1)+biases1)
weights2 = tf.get_va... | https://stackoverflow.com/questions/63653898/i-m-using-tenserflow-1-x-by-google-colab-but-why-i-m-getting-error-in-that |
Question: <p>I am using Pytorch for image classification. I am looking for CNN models pretrained on a dataset other than ImageNet, I have found a link to a ".ckpt" file. I also found tutorials on loading this file with Tenserflow, but not using pytorch.
How can I load pretrained model using Pytorch from ".ckpt" file ?... | https://stackoverflow.com/questions/59023336/loading-pretrained-cnn-model-from-ckpt-file-using-pytorch |
Question: <p>I want to run Tensorflow GPU in Pycharm on Linux Mint. </p>
<p>I tried some guides like these</p>
<p><a href="https://medium.com/@p.venkata.kishore/install-anaconda-tenserflow-gpu-keras-and-pycharm-on-windows-10-6bfb39630e4e" rel="nofollow noreferrer">https://medium.com/@p.venkata.kishore/install-anacond... | https://stackoverflow.com/questions/55549257/how-to-run-tensorflow-gpu-in-pycharm |
Question: <p>I just began my Deep learning journey with Keras along with Tenserflow. I followed a tutorial that used a feed forward model on MNIST dataset. The strange part is that I used the same complied code, yet, I got a higher accuracy rate than the exact same code. I'm looking to understand why or how can this ha... | https://stackoverflow.com/questions/54318167/looking-for-input-on-an-accuracy-rate-that-is-different-than-the-exact-deep-lear |
Question: <p>I'm in a group project in school and we are currently using the <a href="https://github.com/tensorflow/models/tree/master/research/object_detection" rel="nofollow noreferrer">tensorflow object detection API</a>. The object detection works great but we are very interested in how the developers of this API h... | https://stackoverflow.com/questions/49954591/where-can-i-find-more-information-about-the-tests-made-to-verify-the-functionali |
Question: <p>I have written a voice recognition python , i have used tenserflow keras model.</p>
<p>When i am giving the input to my model after running for 200 Epoch the exception raises, i tried to solve but its not working.</p>
<p>I am getting this error can't pickle weakref objects.</p>
<p>Exception Trace</p>
<pre>... | https://stackoverflow.com/questions/67661244/how-to-pickle-weakref-in-python-tensorflow-keras |
Question: <p>I used this command:</p>
<pre class="lang-sh prettyprint-override"><code>bazel test --config opt //tensorflow/tools/lib_package:libtensorflow_test
</code></pre>
<p>but I get this error:</p>
<blockquote>
<p>ERROR: C:/tenserflow/tensorflow-r1.14/tensorflow/tools/lib_package/BUILD:138:1: Executing genrule //t... | https://stackoverflow.com/questions/64517692/tensorflow-build-fails |
Question: <p>I am trying to multiply sub-matrix on a sub-vector. It seems that such multiplication should be faster that multiplication of a whole matrix on a whole vector, but time measurements say opposite:</p>
<pre><code>B = np.random.randn(26200, 2000)
h = np.random.randn(2000)
%time z = B @ h
CPU times: user 56 m... | https://stackoverflow.com/questions/53903938/effective-matrix-slicing-with-numpy |
Question: <p>I tried in keras (using tenserflow backend) to classify and to predict the multi-class images. i built the model with accuracy 98 % and validation accuracy was 96 %. I predicted the probability of image classes and i got the probability values. When i am trying to predict the images with existing model (al... | https://stackoverflow.com/questions/57250281/getting-same-probability-values-for-running-the-same-code-many-times-in-predicti |
Question: <p>I am trying to run spot-rna on my windows pc. The computer is absolutely brand new and was opened today.
I have installed python 3.6 and anaconda3. I also installed tensorflow in a virtual environment.
Basically, I followed the installation steps (for gpu) given here: <a href="https://github.com/jaswinders... | https://stackoverflow.com/questions/67361713/tensorflow-not-recognized-even-though-it-is-installed |
Question: <p>I have trained a model in Tensorflow (v2.0) Keras locally.
I now need to upload this pretrained model into Google Datalab to make predictions on a large batch of data. Tenserflow version available on Datalab is 1.8 but I assume backward compatibility.</p>
<p>I have uploaded the saved model (model.h5) onto... | https://stackoverflow.com/questions/58821870/how-to-load-pretrained-tensorflow-model-from-google-cloud-storage-into-datalab |
Question: <p>My plan is to use Python Machine Learning on an API key. By using that I will then use Tenserflow to translate that code into Javascript and start using my model there. </p>
<p>I don't know if this is possible and I don't know if you even can use an API key from Javascript in Python. So I tried to find an... | https://stackoverflow.com/questions/56202889/is-it-possible-to-use-api-keys-from-javascript-in-a-python-model-and-then-use |
Question: <p>I am used to work with tenserflow - keras but now I am forced to start working with Pytorch for flexibility issues. However, I don't seem to find a pytorch code that is focused on training only the classifciation layer of a model. Is that not a common practice ? Now I have to wait out the calculation of th... | https://stackoverflow.com/questions/70236736/pytorch-skip-calculating-features-of-pretrained-models-for-every-epoch |
Question: <p>I'm trying to build a project using Tensorflow Lite on my debian 11 machine, however it says I'm getting an undefined reference on some functions.</p>
<p>Here is the code I'm trying to run:</p>
<pre class="lang-cpp prettyprint-override"><code>// Works
std::unique_ptr<tflite::FlatBufferModel> model =
... | https://stackoverflow.com/questions/75234194/c-tensorflow-lite-undefined-referance |
Question: <p>I am new to Tensorflow and Python. I am trying to install the tenserflow on the aarch64 platform. I am getting the multiple errors while installing.</p>
<pre><code>pip -V
pip 20.2.4
python3 -V
Python 3.7.8
</code></pre>
<p>Trying to install</p>
<pre><code>pip install tensorflow-2.3.0-cp37-none-linux_aarch6... | https://stackoverflow.com/questions/64641923/error-while-installing-tensorflow-on-aarch64 |
Question: <p>when I try to import keras on a Jupyter notebook I receive this error message: ModuleNotFoundError: No module named 'tensorflow'.</p>
<p>I need to use keras to build an LSTM model fora project and am a beginner in python so I don't know how to get around this error. I have tried to install tenserflow and k... | https://stackoverflow.com/questions/70276937/modulenotfounderror-no-module-named-tensorflow-on-jupyter-notebook |
Question: <p>I have a network written in tensorflow keras functional API.
I'd like to use the gradient of one layer w.r.t to the previous layer as input for another layer.
I tried gradient tape and tf.gradients and none of them worked. I get the following error:</p>
<p><code>ValueError: tf.function-decorated function t... | https://stackoverflow.com/questions/73478858/gradient-of-one-layer-w-r-t-another-layer-when-there-is-an-input-layer-and-no-v |
Question: <p>I am training NN for the regression problem. So the output layer has a linear activation function. NN output is supposed to be between -20 to 30. My NN is performing good most of the time. However, sometimes it gives output more than 30 which is not desirable for my system. So does anyone know any activati... | https://stackoverflow.com/questions/56385199/ways-to-limit-output-of-nn-regression-problem-in-certain-limiti-e-i-want-my-nn |
Question: <p>I'm new to tensorflow. I installed python and tensorflow. I'm getting below error after running my sample code. </p>
<p>I have installed tensorflow by below command. I saw that the below command seems for mac, but I have used this command only to install tensorflow, it is successfully installed. I did not... | https://stackoverflow.com/questions/52428484/tensorflow-is-not-running-in-windows-10 |
Question: <p>I an using tenserflow to build a model</p>
<pre><code>inputs1 = Input(shape=(2048,))
fe1 = Dropout(0.5)(inputs1)
fe2 = Dense(256, activation='relu')(fe1)
inputs2 = Input(shape=(max_length,))
se1 = Embedding(vocab_size, embedding_dim, mask_zero=True)(inputs2)
se2 = Dropout(0.5)(se1)
se3 = LSTM(256)(se2)
de... | https://stackoverflow.com/questions/66477430/model-fit-generator-cannot-convert-a-symbolic-tensor-args-20-to-a-numpy-arr |
Question: <p>I am on popos 20.04 LTS and I want to use <a href="https://support.system76.com/articles/tensorman/" rel="nofollow noreferrer">Tensorman</a> for tenserflow/python. I'm new into docker and I want to install additional dependencies for example using default Image I can run jupyter notebook using these comman... | https://stackoverflow.com/questions/70721182/how-to-install-additional-dependencies-in-tensorman |
Question: <p>I'm a new in Tensorflow. I want to implement an algorithm in Tensorflow that has a part of simple logic described bellow.</p>
<p>I have a matrix (the size of matrix could be vary from a batch size). I need to replace all values in the matrix with zeros except maximum values in each row.</p>
<p>I want to ... | https://stackoverflow.com/questions/49154318/tensorflow-implementation-for-a-simple-logic |
Question: <p>Usually, pip3 works normally, but after installing tenser flow using pip, for some reason pip is not working anymore. For example, I did <code>pip freeze</code> to get my packages, but it came up with this error.</p>
<pre><code> Traceback (most recent call last):
File "/Library/Frameworks/Python.fram... | https://stackoverflow.com/questions/52434321/whenever-i-do-pip3-freeze-or-any-pip3-command-in-my-mac-terminal-it-raises-a-sy |
Question: <p>I tried to compile on windows c program with tenserflow c api and tenserflow.dll from <a href="https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-cpu-windows-x86_64-1.12.0.zip" rel="nofollow noreferrer">https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-cpu-windows-x86... | https://stackoverflow.com/questions/54426204/how-can-i-fix-windows-c-api-error-with-tensorflow-dll |
Question: <p>Just run a few lines with keras Sequential() crashes jupyter notebook kernel. Firstly it was GPU memory which reached all volume (no matter it is 3090 with 24 Gb). Then I took some precauses like</p>
<pre><code>config = tf.compat.v1.ConfigProto()
config.gpu_options.allow_growth = True
session = tf.compat.v... | https://stackoverflow.com/questions/67168328/keras-sequential-crashes-kernel |
Question: <p>I've been walking through the RNN code in TenserFlow tutorial: <a href="https://www.tensorflow.org/tutorials/recurrent" rel="nofollow noreferrer">https://www.tensorflow.org/tutorials/recurrent</a></p>
<p>The original RNN code is here: <a href="https://github.com/tensorflow/models/blob/master/tutorials/rnn... | https://stackoverflow.com/questions/42433317/tensorflow-session-run-hangs-while-attempting-to-restore-rnn-model-based-on-tu |
Question: <p>Is there any way to develop project by using Kotlin Multiplateform and tensor flow lite model in the shared logic. Target is to use same tensor flow model with same kotlin code to retrieve data from it with android and iOS both. UI is desired to be developed separately with platform specific code. </p>
<p... | https://stackoverflow.com/questions/60246182/kotlin-multiplateform-with-tensorflowlite |
Question: <p>For any Keras layer (<code>Layer</code> class), can someone explain how to understand the difference between <code>input_shape</code>, <code>units</code>, <code>dim</code>, etc.? </p>
<p>For example the doc says <code>units</code> specify the output shape of a layer. </p>
<p>In the image of the neural n... | https://stackoverflow.com/questions/44747343/keras-input-explanation-input-shape-units-batch-size-dim-etc |
Question: <p>While trying to reconcile my understanding of LSTMs pointed out here in <a href="http://colah.github.io/posts/2015-08-Understanding-LSTMs/" rel="nofollow noreferrer">this post by Christopher Olah</a> implemented in Keras and following the <a href="http://machinelearningmastery.com/time-series-prediction-ls... | https://stackoverflow.com/questions/38714959/understanding-keras-long-short-term-memories-lstms |
Question: <p>I'm running a Keras model, with a submission deadline of 36 hours, if I train my model on the cpu it will take approx 50 hours, is there a way to run Keras on gpu?</p>
<p>I'm using Tensorflow backend and running it on my Jupyter notebook, without anaconda installed.</p>
Answer: <p>Yes you can run keras m... | https://stackoverflow.com/questions/45662253/can-i-run-keras-model-on-gpu |
Question: <p>If I want to use the BatchNormalization function in Keras, then do I need to call it once only at the beginning?</p>
<p>I read this documentation for it: <a href="http://keras.io/layers/normalization/">http://keras.io/layers/normalization/</a></p>
<p>I don't see where I'm supposed to call it. Below is my... | https://stackoverflow.com/questions/34716454/where-do-i-call-the-batchnormalization-function-in-keras |
Question: <p>I try to understand LSTMs and how to build them with Keras. I found out, that there are principally the 4 modes to run a RNN (the 4 right ones in the picture)</p>
<p><a href="https://i.sstatic.net/b4sus.jpg" rel="noreferrer"><img src="https://i.sstatic.net/b4sus.jpg" alt="enter image description here"></a... | https://stackoverflow.com/questions/43034960/many-to-one-and-many-to-many-lstm-examples-in-keras |
Question: <p>I have built a neural network with Keras. I would visualize its data by Tensorboard, therefore I have utilized:</p>
<pre class="lang-py prettyprint-override"><code>keras.callbacks.TensorBoard(log_dir='/Graph', histogram_freq=0,
write_graph=True, write_images=True)
</code></pre>... | https://stackoverflow.com/questions/42112260/how-do-i-use-the-tensorboard-callback-of-keras |
Question: <p>I am trying to understand the role of the <code>Flatten</code> function in Keras. Below is my code, which is a simple two-layer network. It takes in 2-dimensional data of shape (3, 2), and outputs 1-dimensional data of shape (1, 4):</p>
<pre><code>model = Sequential()
model.add(Dense(16, input_shape=(3, 2... | https://stackoverflow.com/questions/43237124/what-is-the-role-of-flatten-in-keras |
Question: <p>I get different results (test accuracy) every time I run the <code>imdb_lstm.py</code> example from Keras framework (<a href="https://github.com/fchollet/keras/blob/master/examples/imdb_lstm.py">https://github.com/fchollet/keras/blob/master/examples/imdb_lstm.py</a>)
The code contains <code>np.random.seed(... | https://stackoverflow.com/questions/32419510/how-to-get-reproducible-results-in-keras |
Question: <p>How do I print the summary of a model in PyTorch like what <code>model.summary()</code> does in Keras:</p>
<pre><code>Model Summary:
____________________________________________________________________________________________________
Layer (type) Output Shape Param # Connec... | https://stackoverflow.com/questions/42480111/how-do-i-print-the-model-summary-in-pytorch |
Question: <p>I have a single directory which contains sub-folders (according to labels) of images. I want to split this data into train and test set while using ImageDataGenerator in Keras. Although model.fit() in keras has argument validation_split for specifying the split, I could not find the same for model.fit_gene... | https://stackoverflow.com/questions/42443936/keras-split-train-test-set-when-using-imagedatagenerator |
Question: <p>Keras documentation isn't clear what this actually is. I understand we can use this to compress the input feature space into a smaller one. But how is this done from a neural design perspective? Is it an autoenocder, RBM?</p>
Answer: <p>As far as I know, the Embedding layer is a simple matrix multiplicati... | https://stackoverflow.com/questions/38189713/what-is-an-embedding-in-keras |
Question: <p>I am using deep learning library keras and trying to stack multiple LSTM with no luck.
Below is my code</p>
<pre><code>model = Sequential()
model.add(LSTM(100,input_shape =(time_steps,vector_size)))
model.add(LSTM(100))
</code></pre>
<p>The above code returns error in the third line <code>Exception: Inpu... | https://stackoverflow.com/questions/40331510/how-to-stack-multiple-lstm-in-keras |
Question: <p>How to load a model from an HDF5 file in Keras?</p>
<p>What I tried:</p>
<pre><code>model = Sequential()
model.add(Dense(64, input_dim=14, init='uniform'))
model.add(LeakyReLU(alpha=0.3))
model.add(BatchNormalization(epsilon=1e-06, mode=0, momentum=0.9, weights=None))
model.add(Dropout(0.5))
model.add(... | https://stackoverflow.com/questions/35074549/how-to-load-a-model-from-an-hdf5-file-in-keras |
Question: <p>I'm starting to learn Keras, which I believe is a layer on top of Tensorflow and Theano. However, I only have access to AMD GPUs such as the AMD R9 280X.</p>
<p>How can I setup my Python environment such that I can make use of my AMD GPUs through Keras/Tensorflow support for OpenCL?</p>
<p>I'm running o... | https://stackoverflow.com/questions/37892784/using-keras-tensorflow-with-amd-gpu |
Question: <p>I have Keras installed with the Tensorflow backend and CUDA. I'd like to sometimes on demand force Keras to use CPU. Can this be done without say installing a separate CPU-only Tensorflow in a virtual environment? If so how? If the backend were Theano, the flags could be set, but I have not heard of Te... | https://stackoverflow.com/questions/40690598/can-keras-with-tensorflow-backend-be-forced-to-use-cpu-or-gpu-at-will |
Question: <p>I got this error when I tried to modify the learning rate parameter of SGD optimizer in Keras. Did I miss something in my code or my Keras was not installed properly?</p>
<p>Here is my code:</p>
<pre><code>from tensorflow.python.keras.models import Sequential
from tensorflow.python.keras.layers import Dens... | https://stackoverflow.com/questions/50056356/could-not-interpret-optimizer-identifier-error-in-keras |
Question: <p>I was wondering if it was possible to save a partly trained Keras model and continue the training after loading the model again.</p>
<p>The reason for this is that I will have more training data in the future and I do not want to retrain the whole model again.</p>
<p>The functions which I am using are:</p>... | https://stackoverflow.com/questions/42666046/loading-a-trained-keras-model-and-continue-training |
Question: <p>I have noticed that <em>weight_regularizer</em> is no more available in Keras and that, in its place, there are <em>activity</em> and <em>kernel</em> regularizer.
I would like to know:</p>
<ul>
<li>What are the main differences between <em>kernel</em> and <em>activity</em> regularizers?</li>
<li>Could I ... | https://stackoverflow.com/questions/44495698/keras-difference-between-kernel-and-activity-regularizers |
Question: <p>I am unsure how to interpret the default behavior of Keras in the following situation:</p>
<p>My Y (ground truth) was set up using scikit-learn's <code>MultilabelBinarizer</code>().</p>
<p>Therefore, to give a random example, one row of my <code>y</code> column is one-hot encoded as such:
<code>[0,0,0,1,... | https://stackoverflow.com/questions/44164749/how-does-keras-handle-multilabel-classification |
Question: <p>I am using Keras (with Theano) to train my CNN model. Does anyone has idea how can I use it in my C++ application? Does anyone tried something similar? I have idea to write some python code that will generate a c++ code with network functions - any suggestion on it?</p>
<p>I found a similar question <a hr... | https://stackoverflow.com/questions/36720498/convert-keras-model-to-c |
Question: <p>After Training, I saved Both Keras whole Model and Only Weights using </p>
<pre><code>model.save_weights(MODEL_WEIGHTS) and model.save(MODEL_NAME)
</code></pre>
<p>Models and Weights were saved successfully and there was no error.
I can successfully load the weights simply using model.load_weights and th... | https://stackoverflow.com/questions/53740577/attributeerror-str-object-has-no-attribute-decode-while-loading-a-keras |
Question: <p>I know the default backend for Keras has switched from Theano to TensorFlow, but with the dev version of Theano I can train on the GPU with OpenCL (I have an AMD card). </p>
<p>However, when I import Keras, it only uses the TensorFlow backend <strong>even after I changed the values in the Keras configurat... | https://stackoverflow.com/questions/43054687/keras-ignoring-values-in-home-keras-keras-json-file |
Question: <p>I have fine-tuned inception model with a new dataset and saved it as ".h5" model in Keras. now my goal is to run my model on android Tensorflow which accepts ".pb" extension only. question is that is there any library in Keras or tensorflow to do this conversion? I have seen this post so far : <a href="ht... | https://stackoverflow.com/questions/45466020/how-to-export-keras-h5-to-tensorflow-pb |
Question: <p>I have installed Keras using this command:</p>
<pre><code>sudo pip install keras
</code></pre>
<p>It installed properly and worked fine until I tried to import application modules:</p>
<pre><code>from keras.applications.vgg16 import VGG16
Using Theano backend.
Couldn't import dot_parser, loading of dot ... | https://stackoverflow.com/questions/41414489/how-to-uninstall-keras |
Question: <p>In Keras, we can return the output of <code>model.fit</code> to a history as follows:</p>
<pre><code> history = model.fit(X_train, y_train,
batch_size=batch_size,
nb_epoch=nb_epoch,
validation_data=(X_test, y_test))
</code></pre>
<p>Now, ho... | https://stackoverflow.com/questions/41061457/keras-how-to-save-the-training-history-attribute-of-the-history-object |
Question: <p>I am trying to grasp what TimeDistributed wrapper does in Keras.</p>
<p>I get that TimeDistributed "applies a layer to every temporal slice of an input."</p>
<p>But I did some experiment and got the results that I cannot understand.</p>
<p>In short, in connection to LSTM layer, TimeDistributed and just ... | https://stackoverflow.com/questions/47305618/what-is-the-role-of-timedistributed-layer-in-keras |
Question: <p>I have trained a binary classification model with CNN, and here is my code</p>
<pre><code>model = Sequential()
model.add(Convolution2D(nb_filters, kernel_size[0], kernel_size[1],
border_mode='valid',
input_shape=input_shape))
model.add(Activation('relu'))
mo... | https://stackoverflow.com/questions/41711190/keras-how-to-get-the-output-of-each-layer |
Question: <p>If I have something like:</p>
<pre class="lang-python prettyprint-override"><code>model = Model(inputs = input, outputs = [y1,y2])
l1 = 0.5
l2 = 0.3
model.compile(loss = [loss1,loss2], loss_weights = [l1,l2], ...)
</code></pre>
<p>what does Keras do with the losses to obtain the final loss?
Is it some... | https://stackoverflow.com/questions/49404309/how-does-keras-handle-multiple-losses |
Question: <p>I have a functional model in Keras (Resnet50 from repo examples). I trained it with <code>ImageDataGenerator</code> and <code>flow_from_directory</code> data and saved model to <code>.h5</code> file. When I call <code>model.predict</code> I get an array of class probabilities. But I want to associate them ... | https://stackoverflow.com/questions/38971293/get-class-labels-from-keras-functional-model |
Question: <p>So basically, I am fairly new to programming and using python. I am trying to build an ANN model for which I have to use Tensor flow, Theano and Keras library. I have Anaconda 4.4.1 with Python 3.5.2 on Windows 10 x64 and I have installed these libraries by following method.</p>
<ol>
<li>Create a new envi... | https://stackoverflow.com/questions/45271344/importerror-no-module-named-keras |
Question: <p>What is the difference between <code>categorical_accuracy</code> and <code>sparse_categorical_accuracy</code> in Keras? There is no hint in the <a href="https://keras.io/metrics/" rel="noreferrer">documentation for these metrics</a>, and by asking Dr. Google, I did not find answers for that either.</p>
<p... | https://stackoverflow.com/questions/44477489/keras-difference-between-categorical-accuracy-and-sparse-categorical-accuracy |
Question: <p>I want to initialize a 4*11 matrix using glorot uniform in Keras, using following code:</p>
<pre><code>import keras
keras.initializers.glorot_uniform((4,11))
</code></pre>
<p>I get this output :</p>
<pre><code><keras.initializers.VarianceScaling at 0x7f9666fc48d0>
</code></pre>
<p>How can I visua... | https://stackoverflow.com/questions/46770721/keras-initializers-outside-keras |
Question: <p>The Keras layer documentation specifies the input and output sizes for convolutional layers:
<a href="https://keras.io/layers/convolutional/" rel="noreferrer">https://keras.io/layers/convolutional/</a></p>
<p>Input shape: <code>(samples, channels, rows, cols)</code></p>
<p>Output shape: <code>(samples, f... | https://stackoverflow.com/questions/43306323/keras-conv2d-and-input-channels |
Question: <p>It is not clear for me the difference between loss function and metrics in Keras. The documentation was not helpful for me.</p>
Answer: <p>The loss function is used to optimize your model. This is the function that will get minimized by the optimizer.</p>
<p>A metric is used to judge the performance of ... | https://stackoverflow.com/questions/48280873/what-is-the-difference-between-loss-function-and-metric-in-keras |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.