2 votes

scikeras.wrappers.KerasClassifier returning ValueError: Could not interpret metric identifier: loss

Downgrading tensorflow to version 2.15 did the trick. tensorflow==2.15 scikit-learn==1.14.post1 scikeras==0.12
Datagniel's user avatar
2 votes

scikeras.wrappers.KerasClassifier returning ValueError: Could not interpret metric identifier: loss

This is just a problem with the tensorflow version. It can be solved with tensorflow==2.15.0. It has nothing to do with scikit-learn, scikeras, and python versions.
shadow's user avatar
  • 21
2 votes
Accepted

TypeError while implementing Neural Network code

Try to place the function call of nor_NN() outside of the class definition, not inside it. This might be causing the error because the code inside the class definition is being executed. Corrected ...
woka's user avatar
  • 60
2 votes
Accepted

Effective learning rate when using tf.distribute.MirroredStrategy (one host, multi-GPU)

The general advice is to use a larger learning rate when using a larger batch size, as each steps processes more data. From the guide Distributed training with Keras: For larger datasets, the key ...
Lescurel's user avatar
  • 11.3k
1 vote

Does one-shot-learning by definition allow to have only one training instance per class and would this be even feasible?

In the strictest sense, one-shot learning means a machine learns from just one example of each thing. It needs to figure out the big picture from a small bit of information (Humans are good at this, ...
gmifflen's user avatar
  • 413
1 vote

Is TensorFlowOnSpark compatible with Synapse?

Apache Spark in Azure Synapse Analytics provides machine learning with big data, enabling valuable insights from vast amounts of structured, unstructured, and rapidly changing data. Multiple options ...
DileeprajnarayanThumula's user avatar
1 vote
Accepted

Trying to concatenate a row to a matrix in tensorflow

Everything is good except the axis of concatenation. It should be axis=1. def generate_sequence(self, input_data): predicted_sequence = tf.convert_to_tensor(input_data, dtype=tf.float32) data_shape = ...
rajkumar_data's user avatar
1 vote

How do packages like Tensorflow or PyTorch distribute their shared libraries

Usually, dynamic link libraries are distributed along with packages. Take Pytorch for example, when installing pytorch==2.2.1+cu121, linux users download the package from: https://download.pytorch.org/...
LittleNyima's user avatar
1 vote
Accepted

How to replace a model layer using TensorFlow 2.16?

model._operations[1] = BatchNormalization() works. Please keep the following in mind: This code is accessing a private member of the class. It's an undocumented implementation detail, which might ...
Tobias Hermann's user avatar
1 vote

Google Colab: error when importing TFBertModel

I found the solution: downgraded tensorflow and tf-keras versions.
Nata107's user avatar
  • 55
1 vote
Accepted

Google Colab: error when importing TFBertModel

For the runtime Python3 + CPU, created today, I was able to run the following TFBertModel just fine in Google Colab today. I noticed that our Tensorflow versions differ, other than that I don't ...
michaelt's user avatar
  • 128
1 vote
Accepted

Azure deployment error "TypeError: metaclass conflict" when importing tensorflow (1.13.1) in project code

TypeError: metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases This is because of clashes between the metaclasses used in ...
Suresh Chikkam's user avatar
1 vote

Why does my plot_model() look like this? (Tensorflow, Keras)

I believe that your error is coming from your definition of "Dense": would you be able to show how to you imported that layer definition? The below code (which is the same as your initial ...
Zoe's user avatar
  • 51
1 vote
Accepted

Cannot install tensorflow ver 2.3.0 (distribution not found)

Tensorflow 2.3.0 is still available, but TF 2.3.0 was released for Python 3.5-3.8. From the versions displayed to you, it seems that you are using Python 3.9. So, to install this specific version you ...
K. Bogdan's user avatar
  • 505
1 vote
Accepted

How to classify multiple classes in TensorFlow

First of all, you need to have 3 classes in your dataset, which means that you need to distinguish sneeze samples as you have done it for cough/not cough. Then, you need to convert your output to one ...
Reza's user avatar
  • 408
1 vote
Accepted

Keras predict/predict_on_batch giving different answers than predict_step/__call__()

I have tested the given sample code in tf.keras==2.12.0 and found a possible bug in the API and it fails only on GPU. In your sample code, the mismatch occurred due to the relu activation. If we set ...
Innat's user avatar
  • 16.8k
1 vote
Accepted

ImportError: cannot import name 'ops'

You trying to use keras 3 command so u need to upgrade your keras. pip install --upgrade keras You will also needed to update your tensorflow to avoid several incompatibilities pip install --upgrade ...
Muhammed Samed Özmen's user avatar
1 vote
Accepted

ValueError: Dimensions must be equal ResNet-50 Transfer Learning TF

As you are using SparseCategoricalCrossentropy as loss I assume you have labels as a one dimensional scaler array. But then you should Also change you accuracy metric to work on these kind of ...
Taha Akbari's user avatar
1 vote
Accepted

broadcasting tensor matmul over batches

It looks like you have: yTrue_yHat_allBatches_tensorSub shaped (2, 15) interceptXY_data_allBatches[:, :, :-1] shaped (2, 15, 5) If you want to multiply them to get a resulting shape of (2, 5), then ...
Muhammed Yunus's user avatar
1 vote
Accepted

Deep learning models yielding high training accuracy but poor performance on testing data in binary text classification

The problem you are facing is probably overfitting. overfitting occurs when an algorithm fits too closely or even exactly to its training data, resulting in a model that can’t make accurate ...
Shahriar's user avatar
1 vote

Which is easier, yolo or tensorflow

YOLO requires fewer computational resources compared to some TensorFlow models, which can be beneficial for Raspberry Pi applications. And YOLO is also best for real time object detection as compared ...
1 vote

Value error problem I encountered with tensorflow optimizer parameter

I'm assuming you want something like this: model.compile(loss=tf.keras.losses.mae, optimizer=tf.keras.optimizers.Adam(learning_rate=0.01), metrics=['mae'] ) It's no longer ...
twalow's user avatar
  • 572
1 vote

TensorFlow Error loading model AttributeError: Exception encountered when calling Flatten.call(). 'list' object has no attribute 'shape'

Flatten() works for a single tensor and it seems you're handing it a list. That is why it says it cannot find ".shape" on a list. In order to fix this: Inspect your model's shape.. You have ...
twalow's user avatar
  • 572
1 vote
Accepted

the layer sequential has never been called and thus has no defined input

From tensorflow 2.16, keras 3 is the default keras version. Legacy keras functions are not working anymore. A workaround is to set TF_USE_LEGACY_KERAS environment variable to 1 before importing ...
sefiks's user avatar
  • 1,444
1 vote

Error when using keras: module 'keras.layers' has no attribute 'TextVectorization'

After tensorflow 2.0 you should access keras using tf.keras whenever you work with tensorflow and Textvectorization as per the docs exists there - https://www.tensorflow.org/api_docs/python/tf/keras/...
Karan Shishoo's user avatar
1 vote

Tensorflow is not using/seeing my GPU from version 2.11 onwards

In Tensorflow version 2.11 and upwards there is no (native) GPU support on Windows. That means that if you want your Tensorflow to see and use your GPU, you need to install Tensorflow version 2.10. ...
1 vote

Tensorflow 2.10.0 not detecting GPU

I had to download the right version of cudnn from the NVIDIA website. I didn't know before that I needed to install cudnn both on Win11 and conda's virtual environment
Han Sover's user avatar
1 vote

ImportError: /usr/lib/aarch64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.30' not found

In my case I was running Amazon Linux, all I had to do is export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/anaconda3/lib
Al Kannan's user avatar
1 vote

Computing Bounding Boxes from a Mask-Image (Tensorflow or other)

This is much simpler and is fast from skimage.measure import label, regionprops # from skimage.morphology import label mask_0 = cv2.imread('delete.png') thresh = 127 mask_0 = cv2.threshold(mask_0, ...
Sourav Dalai's user avatar
1 vote

How to convert a CoreML Model to a TensorFlow Model?

Here try this https://github.com/onnx/onnxmltools it supports CoreML conversion
Ali Akram's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible