artificial-intelligence

Cannot generate random ints inside TensorFlow2.0 "call" function

Cannot generate random ints inside TensorFlow2.0 "call" function Question: I am trying to implement a custom dropout layer. In this dropout layer I want to generate a random number and turn on/off that output. The idea is simple and I thought the implementation would be too. I have tried using the regular ‘random’ python function, …

Total answers: 1

Keras Reshape Layer Error: Total Size of New Array Must Be Unchanged

Keras Reshape Layer Error: Total Size of New Array Must Be Unchanged Question: This is my model import torch import os import cv2 import numpy as np import tensorflow as tf from tensorflow.keras.preprocessing.image import ImageDataGenerator import mediapipe as mp from sklearn.metrics import multilabel_confusion_matrix, accuracy_score # Define the path to your training and testing data directories …

Total answers: 1

ImportError: Using the Trainer with PyTorch requires accelerate = 0.20.1

ImportError: Using the Trainer with PyTorch requires accelerate = 0.20.1 Question: Please help me when I tried to use it in my Google Colab for transformers error: ImportError: Using the Trainer with PyTorch requires accelerate=0.20.1: Please run pip install transformers[torch] or pip install accelerate -U` NOTE: If your import is failing due to a missing …

Total answers: 2

YOLOv5: does best.pt control for overfitting?

YOLOv5: does best.pt control for overfitting? Question: After each YOLOv5 training, two model files are saved: last.pt and best.pt. I’m aware that: last.pt is the latest saved checkpoint of the model. This will be updated after each epoch. best.pt is the checkpoint that has the best validation loss so far. It is updated whenever the …

Total answers: 1

TypeError: Unhashable type: 'numpy.ndarray' in keras

TypeError: Unhashable type: 'numpy.ndarray' in keras Question: I have a code below while True: question = input("你: ") question_seq = tokenizer.texts_to_sequences([question]) question_seq_padded = keras.preprocessing.sequence.pad_sequences(question_seq, maxlen=max_len) answer_seq = model.predict(question_seq_padded).argmax(axis=-1)[0] answer = tokenizer.index_word[answer_seq] print("機器人:", answer) And when i ran it, happened some wrong answer = tokenizer.index_word[answer_seq] issued error TypeError: Unhashable type: ‘numpy.ndarray’ I try to find the …

Total answers: 2

how regroup multiple fit calls on a single epoche with keras

how regroup multiple fit calls on a single epoche with keras Question: I am training a model with kearas on Go of datas, at a point where my computer can’t handle the RAM needed. So I am trying to implement my training as 1 epoche is done with multiple model.fit calls, with somthing like : …

Total answers: 2

Problem tokenizing with HuggingFace's library when fine tuning bloom

Problem tokenizing with HuggingFace's library when fine tuning bloom Question: I have a problem with my tokenizer function. To be honest I am quiet lost, since I do not really understand whats happening inside the transformer library. Here is what I wanted to do: I would like to fine tune the BLOOM model to a …

Total answers: 2

Reading Sudokus from text file and applying backtracking

Reading Sudokus from text file and applying backtracking Question: I have just begun with python, so excuse me if these are noob questions or if the questions are already answered. I am trying to read multiple sudoku puzzles and apply the algorithm I found online. The code utilizes a grid(list[list[int]]) setup. I have tried looking …

Total answers: 2

why it says I don't have admin privilage to install chatterbot?

why it says I don't have admin privilage to install chatterbot? Question: I tried to install chatterbot on my up to date python, pip didn’t work, everything including running as administrator and every other thing that I don’t remember. so I went to here: C:UsersaliAppDataLocalPackagesPythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0 with CMD, and did a git clone thing and a …

Total answers: 1