AI error database
Something broke and the message means nothing to you. That happens to everyone. Find the error here to see what it is telling you, why it happens, and the fix.
110 errors explained
anthropic
-
BadRequestError 400: max_tokens: Field required (Anthropic)The Anthropic Messages API requires max_tokens on every request — it is the cap on the reply's length. Pass a value sized for the response you expect.
-
BadRequestError 400: tool_use ids were found without tool_result blocks (Anthropic)After the model calls a tool, your very next message must return a tool_result for every tool_use id. Rebuild the conversation so the pairs match exactly.
-
Error 529: overloaded_error — Overloaded (Anthropic)Anthropic's servers are temporarily saturated — nothing in your code is wrong. Retry with exponential backoff and jitter, and let the SDK's built-in retries do…
-
Your credit balance is too low to access the Anthropic APIThe API runs on prepaid credits, and your workspace has run out — a Claude Pro subscription does not include API credits. Buy credits or enable auto-reload in…
chromadb
-
RuntimeError: Your system has an unsupported version of sqlite3. Chroma requires sqlite3 >= 3.35.0Your Python's built-in sqlite3 is older than ChromaDB needs — common on older Linux distros and hosted platforms. Install pysqlite3-binary and swap it in, or…
conda
-
'conda' is not recognized as an internal or external commandYour shell cannot find the conda program — it is installed but not on this shell's PATH. Use the Anaconda Prompt, or run conda init once from it.
-
OMP: Error #15: Initializing libiomp5md.dll, but found libiomp5md.dll already initializedTwo copies of the OpenMP runtime loaded into one process — usually conda-MKL numpy meeting pip torch. Rebuild the environment from one source; the…
-
Solving environment: failed with initial frozen solve (conda)Conda cannot find a package combination that fits your environment — or is taking forever to try. Use the libmamba solver, prefer conda-forge with strict…
cuda
-
CUDA driver version is insufficient for CUDA runtime versionYour NVIDIA driver is older than what your framework's CUDA build requires. Update the driver — or install a framework build made for an older CUDA.
-
NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driverThe NVIDIA kernel driver is not loaded — not installed, broken by a kernel update, or blocked by Secure Boot. Reboot first, then reinstall the driver.
git-lfs
-
Model files are tiny pointer files — git-lfs not installed (invalid load key 'v')You cloned a model repo without Git LFS, so every weight file is a 130-byte text stub. Install git-lfs and run git lfs pull — or skip git and use…
-
batch response: This repository is over its data quota (git-lfs)The repo owner's Git LFS bandwidth allowance on GitHub is exhausted, so large files will not download for anyone. As a downloader, get the weights from another…
huggingface
-
Asking to pad but the tokenizer does not have a padding tokenGPT-style models were trained without a pad token. Set tokenizer.pad_token = tokenizer.eos_token, and switch to left padding if you are generating text.
-
GatedRepoError / 401 Unauthorized: Cannot access gated repo (Hugging Face)The model is gated — you must accept its license on the model page and authenticate with a token. Request access first, then log in with huggingface-cli.
-
ImportError: cannot import name 'cached_download' from 'huggingface_hub'huggingface_hub removed the old cached_download function, and an outdated library (often sentence-transformers or diffusers) still imports it. Upgrade the…
-
Killed while loading checkpoint shards (Hugging Face)The operating system killed your process for exhausting system RAM during model load. Load with device_map="auto" so shards stream to the GPU, or quantize at…
-
OSError: We couldn't connect to huggingface.co (offline / cache errors)The download from the Hugging Face Hub failed — network, proxy, an outage, or an accidental offline flag. Retry, check the proxy, or pre-download once and run…
-
RuntimeError: probability tensor contains either inf, nan or element < 0 (generation)The model produced invalid logits during text generation — most often a bfloat16-trained model loaded in float16. Load in bfloat16 or float32, and check your…
-
SafetensorError: Error while deserializing header: HeaderTooLargeThe weights file is not a valid safetensors file — a truncated download, an LFS pointer stub, or a full disk mid-write. Check the file size against the repo…
-
The attention mask and the pad token id were not set (HuggingFace)model.generate() received no attention mask, so it cannot tell padding from real text. Pass the whole tokenizer output with **inputs.
-
The installed version of bitsandbytes was compiled without GPU supportbitsandbytes needs a CUDA GPU, and your install (or machine) does not provide one. Upgrade to a recent version on CUDA machines — on Mac or CPU-only boxes…
-
This tokenizer cannot be instantiated: requires the SentencePiece libraryThe model's tokenizer depends on the sentencepiece package, which is not installed. pip install sentencepiece, restart the kernel, and retry.
-
Token indices sequence length is longer than the specified maximum (HuggingFace)Your text tokenized to more tokens than the model can accept, and the crash will come later if you ignore this warning. Truncate, chunk, or switch to a…
-
UserWarning: do_sample is set to False. However, temperature is set to... (generation flags)You passed sampling parameters while greedy decoding is active, so they are ignored. Set do_sample=True to make temperature and top_p count — and set…
-
ValueError: Target modules not found in the base model (PEFT / LoRA)Your LoRA config names layers that do not exist in this architecture — module names differ between model families. Print the real module names, or use…
-
ValueError: The checkpoint has model type X but Transformers does not recognize this architectureYour installed transformers is older than the model you are loading. Upgrade transformers — or install from source for architectures released this week.
-
ValueError: requires you to execute the configuration file (trust_remote_code)The model's architecture is defined by Python code inside its repo, not inside transformers — and running that code needs your explicit consent. Review the…
jupyter
-
RuntimeError: This event loop is already running / asyncio.run() cannot be called from a running event loopJupyter already runs an asyncio event loop, and asyncio.run() refuses to nest inside it. Await directly in the cell — or apply nest_asyncio for libraries that…
-
The kernel appears to have died. It will restart automatically. (Jupyter)The kernel process crashed hard — out of memory or a native-library failure — so no Python traceback exists. Run the same code as a script in a terminal to see…
langchain
-
ImportError: cannot import name 'OpenAI' from 'langchain'Model classes moved out of the langchain package into langchain-openai and friends. Install the partner package and update the import path.
-
Missing some input keys / Input to PromptTemplate is missing variables (LangChain)The variables in your prompt template do not match the keys you passed at run time — often because literal JSON braces in the template read as variables…
-
ModuleNotFoundError: No module named 'langchain_community'LangChain split into several packages, and community integrations no longer install with the core. pip install langchain-community — or better, the specific…
linux
-
qt.qpa.plugin: Could not load the Qt platform plugin "xcb"Qt cannot start its Linux display plugin — missing xcb system libraries, or OpenCV's bundled Qt clashing with another Qt in the environment. Install the xcb…
llamaindex
-
ModuleNotFoundError: No module named 'llama_index' (v0.10 restructure)LlamaIndex v0.10 split into llama-index-core plus integration packages, and old imports broke. Reinstall cleanly and import from llama_index.core.
llm
-
RateLimitError 429 from an LLM APIYou sent requests or tokens faster than your account is allowed. Check whether the code says rate_limit_exceeded or insufficient_quota — retrying helps one of…
-
This model's maximum context length is N tokens (context_length_exceeded)Your prompt plus the space reserved for the reply is larger than the model's context window. Count tokens before sending and trim history or retrieved context.
-
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)The string you parsed is not JSON at all — often an LLM reply wrapped in markdown fences, or an error page where JSON was expected. Log the raw string, then…
matplotlib
-
UserWarning: Matplotlib is currently using agg, which is a non-GUI backendplt.show() has no window to draw into — matplotlib fell back to its file-only backend. Save the figure on servers, or install a GUI backend on desktops and WSL.
numpy
-
A module that was compiled using NumPy 1.x cannot be run in NumPy 2.0A compiled package in your environment was built against NumPy 1 and your NumPy is 2. Upgrade the affected package to a NumPy-2-compatible release, or pin…
-
AttributeError: module 'numpy' has no attribute 'float'NumPy 1.24 removed the np.float, np.int and np.bool aliases. Use the plain Python names, or upgrade the old library that still uses them.
-
MemoryError: Unable to allocate N GiB for an arrayThe array you asked for does not fit in RAM. Read the shape in the message first — a huge dimension usually means an accidental one-hot or pivot explosion, not…
-
ValueError: Object arrays cannot be loaded when allow_pickle=FalseThe .npy file contains Python objects, and np.load blocks those by default for security. Pass allow_pickle=True only if you trust where the file came from.
-
ValueError: cannot reshape array of size N into shape (...)Reshape can only rearrange elements, never add or remove them, and your target shape needs a different total count. Check where the element count came from…
-
ValueError: operands could not be broadcast together with shapesNumPy could not line up two array shapes for an element-wise operation. Print both shapes, then add the missing axis with keepdims or reshape.
-
ValueError: setting an array element with a sequence (inhomogeneous shape)Your rows have different lengths, so NumPy cannot build a rectangular array from them. Find the odd row out, then pad the data or fix the source.
onnx
-
Specified provider 'CUDAExecutionProvider' is not in available provider names (ONNX Runtime)You have the CPU-only onnxruntime package, or its CUDA/cuDNN requirements are unmet — so inference silently runs on CPU. Install onnxruntime-gpu alone, and…
-
UnsupportedOperatorError: Exporting the operator to ONNX opset version is not supportedYour model uses a PyTorch operation the ONNX exporter cannot translate at the chosen opset. Raise the opset version, try the newer dynamo exporter, or rewrite…
openai
-
APIConnectionError: Connection error (OpenAI / Anthropic)The request never reached the provider — network, proxy, SSL interception, or a wrong base_url. Test with curl to split the problem in half.
-
APIRemovedInV1: openai.ChatCompletion is no longer supportedThe openai Python library changed its entire interface in v1.0. Rewrite the call with the client object — or run the automatic migration tool.
-
AuthenticationError 401: Incorrect API key provided (OpenAI / Anthropic)The API received a key it does not recognise — wrong variable, stray quotes or whitespace, or a revoked key. Check what the client actually loaded, not what…
-
BadRequestError 400: Invalid schema for function (tool calling)The JSON Schema you declared for a tool breaks the provider's validation rules — strict mode has extra requirements beyond plain JSON Schema. Generate schemas…
-
NotFoundError 404: The model does not exist or you do not have access to itThe model name string is wrong, retired, or not available to your account. Copy the exact id from the provider's model list — never type it from memory.
opencv
-
ModuleNotFoundError: No module named 'cv2'The import name is cv2 but the pip package is opencv-python — installing "cv2" gets you nothing. Install exactly one OpenCV variant per environment.
-
cv2.error: (-215:Assertion failed) !ssize.empty() / !_src.empty() (OpenCV)The image you passed to resize or cvtColor is empty — because cv2.imread silently returned None. Check the read result before processing, and watch paths…
-
cv2.error: The function is not implemented. Rebuild the library with Windows, GTK+ ... (imshow)Your OpenCV build has no GUI support — usually the headless variant is installed, or a server has no display. Install opencv-python (not headless), or save…
pandas
-
AttributeError: 'DataFrame' object has no attribute 'append'pandas 2.0 removed DataFrame.append. Use pd.concat — or better, collect rows in a list and build the frame once at the end.
-
KeyError: 'column' / "['column'] not in index" (pandas)The column name you asked for does not exist in the DataFrame. Print df.columns.tolist() and look for whitespace, capitalisation, or a column that became the…
-
ParserError: Error tokenizing data. C error: Expected N fields (pandas)A row in your CSV has more columns than the header suggested — wrong delimiter, unquoted commas, or junk lines before the real header. Look at the raw line the…
-
SettingWithCopyWarning (pandas)You wrote to a slice of a DataFrame, and pandas cannot promise the write reached the original. Do the selection and the assignment in one .loc call.
-
UnicodeDecodeError: 'utf-8' codec can't decode byte (read_csv)The file is not UTF-8 — usually a cp1252 export from Excel or an old Windows system. Pass the right encoding to read_csv, or detect it first.
-
ValueError: Length of values does not match length of index (pandas)You assigned a list or array with the wrong number of rows as a DataFrame column. The values were computed from a different frame — usually the unfiltered one.
-
ValueError: The truth value of a Series is ambiguousYou used a whole pandas Series where Python expected a single True or False. Use & and | with parentheses for filters, and .any() or .all() in if statements.
-
ValueError: You are trying to merge on object and int64 columns (pandas)Your join keys have different dtypes — one side holds strings, the other integers. Cast both key columns to the same type before merging; string is usually the…
-
ValueError: cannot convert float NaN to integerYou cast a column with missing values to int, and NaN has no integer form. Fill or drop the missing values first — or use the nullable Int64 dtype.
pip
-
ERROR: Could not find a version that satisfies the requirement (pip)pip found no installable release for your Python, platform or index. Check Python version and bitness, the package's real name, and whether it lives on a…
-
ERROR: Failed building wheel for X / Microsoft Visual C++ 14.0 or greater is requiredpip found no prebuilt package for your platform and tried to compile from source, which failed. Upgrade pip first, pick versions with wheels, and only install…
-
ERROR: ResolutionImpossible — conflicting dependencies (pip)Two packages demand incompatible versions of a shared dependency, and no combination satisfies both. Read the conflict lines pip prints, then loosen pins or…
-
SSL: CERTIFICATE_VERIFY_FAILED — certificate verify failed (pip / Python)Python cannot verify the server's TLS certificate — usually a corporate proxy re-signing traffic, or a Python install without its certificate bundle. Point…
-
error: externally-managed-environment (pip)Your OS protects its system Python from pip installs. Create a virtual environment for your project — that is the intended fix, not an obstacle to bypass.
pydantic
-
PydanticImportError: BaseSettings has been moved to the pydantic-settings packagePydantic v2 moved BaseSettings into its own package. Install pydantic-settings and update the import — or upgrade the old library that still imports it from…
python
-
ModuleNotFoundError: No module named 'torch'The Python that ran your script does not have PyTorch installed. Almost always you installed into a different Python than the one you are using.
pytorch
-
AssertionError: Torch not compiled with CUDA enabledThe installed PyTorch build is CPU-only, and your code asked for CUDA anyway. Install the CUDA build from pytorch.org's selector — or, on a Mac, use the mps…
-
CUDA error: device-side assert triggeredAn index went outside the valid range inside a GPU kernel — usually a label outside 0..classes-1, or a token id larger than the embedding table. Restart the…
-
CUDA error: no kernel image is available for execution on the deviceYour PyTorch build does not include compiled code for your GPU's generation — typically a brand-new GPU with an older PyTorch. Install the build made for a…
-
CUDA out of memory (PyTorch)PyTorch asked the GPU for more memory than was free. Lower the batch size first, then look for gradients you are keeping by accident.
-
DataLoader worker is killed by signal / insufficient shared memoryThe helper processes loading your data were killed, either because the machine ran out of RAM or because shared memory is too small. Rerun with num_workers=0…
-
Error(s) in loading state_dict: Missing key(s) / Unexpected key(s)The checkpoint's layer names or shapes do not match the model you built. Look at the key prefixes first — a "module." prefix means DataParallel saved it, and a…
-
Expected all tensors to be on the same deviceOne tensor is on the GPU and another is on the CPU. Find the one you forgot to move, and remember that .to() returns a new tensor rather than changing it in…
-
IndexError: Target N is out of bounds (CrossEntropyLoss)A class label is outside the range your output layer allows — labels must run 0 to C-1. Usually labels start at 1, or the output layer has too few units.
-
Loss is NaN during trainingOne arithmetic step produced not-a-number and it spread to every weight. Lower the learning rate first, then check your data and your loss function.
-
OSError: [WinError 126] Error loading fbgemm.dll or one of its dependenciesA Windows dependency of PyTorch 2.4.0's fbgemm.dll is missing on your machine. Upgrade PyTorch past 2.4.0, and install the Microsoft Visual C++ Redistributable.
-
OSError: [WinError 1455] The paging file is too small for this operation to completeWindows ran out of memory commit while loading PyTorch's large CUDA DLLs — often multiplied by DataLoader workers. Enlarge the Windows paging file and cut…
-
RuntimeError: An attempt has been made to start a new process before the current process has finished its bootstrapping phaseOn Windows and macOS, worker processes re-import your script, and unguarded top-level code re-runs forever. Wrap the entry point in if __name__ == "__main__".
-
RuntimeError: Expected 4-dimensional input for 4-dimensional weight (conv2d)Conv2d wants batches of channels-first images — shape [N, C, H, W]. A single image is missing its batch dimension; add it with unsqueeze(0), and permute HWC…
-
RuntimeError: Trying to backward through the graph a second timeYou called backward twice over the same computation, and the graph was freed after the first call. Usually a hidden state or accumulated loss is carrying old…
-
RuntimeError: expected scalar type Float but found Double (PyTorch dtypes)Two tensors in one operation have different dtypes — usually float64 data from NumPy meeting float32 model weights. Convert the input with .float(), and give…
-
RuntimeError: grad can be implicitly created only for scalar outputsYou called backward() on a tensor with more than one element. Reduce the loss to a single number first with .mean() or .sum() — usually a reduction='none' left…
-
RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operationYou edited a tensor in place after autograd saved it for the backward pass. Turn on anomaly detection to find the line, then replace the in-place edit with an…
-
RuntimeError: operator torchvision::nms does not existYour torch and torchvision versions do not match — usually one was upgraded without the other. Reinstall both together, in one command, from the same index.
-
RuntimeError: stack expects each tensor to be equal size (DataLoader)The DataLoader tried to stack samples of different sizes into one batch. Resize images in transforms, or pad variable-length sequences with a collate function.
-
TypeError: can't convert cuda:0 device type tensor to numpyNumPy works in CPU memory, and your tensor lives on the GPU. Chain .detach().cpu().numpy() — and do the move once, not inside every metric call.
-
UnpicklingError: Weights only load failed (torch.load)PyTorch 2.6 made torch.load refuse arbitrary pickled objects by default. For files you trust, pass weights_only=False; for your own pipelines, save plain…
-
element 0 of tensors does not require grad and does not have a grad_fnYou called .backward() on a tensor with no connection to any trainable weight. Usually the loss was computed inside torch.no_grad(), or a step in the middle…
-
mat1 and mat2 shapes cannot be multiplied (shape mismatch)A layer expected a different number of input features than it received. Print the shape going in, and set in_features to match.
-
torch.cuda.is_available() returns FalsePyTorch cannot see your GPU. Check whether you installed the CPU-only wheel first, because that is the cause most of the time.
scikit-learn
-
AttributeError: 'super' object has no attribute '__sklearn_tags__'scikit-learn 1.6 changed its internal tags API, and an older XGBoost or similar wrapper is incompatible with it. Upgrade the wrapper library, or pin…
-
ConvergenceWarning: lbfgs failed to converge (scikit-learn)The optimiser hit its iteration limit before settling. Scale your features first — that fixes most cases — and raise max_iter second.
-
NotFittedError: This instance is not fitted yet (scikit-learn)You called predict or transform on an estimator that never had fit called on it — or on a different object than the one you fitted. Check which instance you…
-
ValueError: Classification metrics can't handle a mix of binary and continuous targetsYou passed probabilities or regression outputs into a metric that expects class labels. Threshold or argmax the predictions first — or switch to a metric that…
-
ValueError: Expected 2D array, got 1D array instead (scikit-learn)scikit-learn wants X as a table — rows by columns — even when there is one feature or one sample. Reshape with (-1, 1) for one feature, or pass a…
-
ValueError: Found input variables with inconsistent numbers of samplesYour X and y have different numbers of rows. Usually one of them was filtered, shifted or reshaped while the other was not.
-
ValueError: Input contains NaN, infinity or a value too large for dtype('float64')Your array has missing values or infinities. Find which columns and rows carry them, then fix them inside a Pipeline so training and prediction are treated…
-
ValueError: The least populated class in y has only 1 member (stratify)A class in your labels has fewer examples than a stratified split needs. Count the classes first — a 1-member class is usually a label typo, not a real…
-
ValueError: Unknown label type: 'continuous' (scikit-learn)You gave a classifier a target of continuous numbers. If you are predicting a quantity, use a regressor; if your labels are real classes stored as floats…
-
ValueError: X has N features, but the model is expecting M featuresThe data you passed at prediction time has a different column count than the data used for fitting. Train-time and inference-time preprocessing drifted apart…
-
ValueError: could not convert string to floatA text value sat where a number was expected — often a category column fed to a model, or numbers stored with commas and currency signs. Find the text columns…
tensorflow
-
ConverterError: Some ops are not supported by the native TFLite runtime (Select TF ops)Your model uses TensorFlow operations that TensorFlow Lite's built-in set does not include. Enable Select TF ops in the converter — accepting a bigger binary…
-
Could not load dynamic library 'libcudart.so' (TensorFlow)TensorFlow cannot find the CUDA libraries it wants, so it silently falls back to CPU. On Linux, install with pip install tensorflow[and-cuda]; on Windows, use…
whisper
-
FileNotFoundError: [WinError 2] The system cannot find the file specified (Whisper / ffmpeg)Whisper and other audio tools shell out to the ffmpeg program, which pip cannot install. Install ffmpeg with your system package manager and reopen the…
windows
-
ImportError: DLL load failed while importing _multiarray_umath (Windows)A compiled package cannot load its native libraries on Windows — usually a missing VC++ runtime or a conda/pip hybrid environment. Install the redistributable…