Skip to content
TheChatArchiveThe Chat Archive
Amazon Novaamazon-nova-experimental-chat-05-14· AmazonHugging Face LMArena Human Preference 140K

On kaggle: from transformers import AutoProcessor, AutoModelForCausalLM from PIL import…

From a Chatbot Arena battleThe same person sent this prompt to two anonymous models at once. Compare it with Kimikimi-k2-0711-preview’s answer.
  1. User

    On kaggle: from transformers import AutoProcessor, AutoModelForCausalLM from PIL import Image import requests import copy %matplotlib inline Output:

    2025-07-16 07:04:54.758798: E external/local_xla/xla/stream_executor/cuda/cuda_dnn.cc:9261] Unable to register cuDNN factory: Attempting to register factory for plugin cuDNN when one has already been registered 2025-07-16 07:04:54.758979: E external/local_xla/xla/stream_executor/cuda/cuda_fft.cc:607] Unable to register cuFFT factory: Attempting to register factory for plugin cuFFT when one has already been registered 2025-07-16 07:04:54.899896: E external/local_xla/xla/stream_executor/cuda/cuda_blas.cc:1515] Unable to register cuBLAS factory: Attempting to register factory for plugin cuBLAS when one has already been registered

  2. Amazon Nova Assistant

    The warnings you're seeing are related to the registration of CUDA plugins (cuDNN, cuFFT, and cuBLAS) and indicate that there is an attempt to register these factories more than once. While these messages are labeled as errors (E), they are often harmless and just indicate that the registration is being attempted multiple times, which is unnecessary but generally doesn't affect the functionality.

    Here's a breakdown of what's happening and how you can address it:

    Understanding the Warnings

    1. cuDNN, cuFFT, cuBLAS:

      • cuDNN: A GPU-accelerated library of primitives for deep neural networks.
      • cuFFT: A GPU-accelerated FFT library.
      • cuBLAS: A GPU-accelerated basic linear algebra subprograms library.

      These libraries are part of the CUDA toolkit and are used by many machine learning frameworks, including TensorFlow and PyTorch, for accelerated computations.

    2. Warning Messages:

      • The messages indicate that there is an attempt to register the factories for these libraries more than once. This typically happens when multiple parts of the code or different libraries try to initialise CUDA plugins simultaneously.
      • Although labelled as errors (E), these messages are usually warnings and do not prevent the code from running. However, they can clutter the output and may indicate some inefficiency in the initialization process.

    Potential Causes

    1. Multiple Imports:
      • If you are using multiple libraries that each try to initialise CUDA, this can cause these warnings. For example, using both TensorFlow and PyTorch in the same script can lead to this issue.
    2. Environment Configuration:
      • Sometimes, the environment configuration, such as having multiple versions of CUDA or cuDNN installed, can cause these warnings.
    3. Transformers Library:
      • The transformers library from Hugging Face may initialize CUDA when importing AutoProcessor and AutoModelForCausalLM. If other libraries also initialize CUDA this will cause the issue.

    Solutions

    1. Suppress Warnings: You can suppress these specific warnings if they do not affect your model's performance. You can use the os module to set the environment variable to ignore these logs.

      import os
      os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'  # Suppress TF warnings
      
      • 0 = all messages are logged (default behaviour)
      • 1 = INFO messages are not printed
      • 2 = INFO and WARNING messages are not printed
      • 3 = INFO, WARNING, and ERROR messages are not printed

      Alternatively, for a more general suppression of warning you can use the warnings library.

      import warnings
      warnings.filterwarnings("ignore", category=UserWarning)
      
    2. Check for Multiple CUDA Initialisations:

      • Ensure that you are not initialising CUDA multiple times in your script. For example if you are using both PyTorch and Tensorflow ensure that you are not calling torch.cuda.is_available() and tf.config.list_physical_devices('GPU')
    3. Environment Cleanup:

      • Ensure that your environment has only one version of CUDA and cuDNN installed. You can use conda or pip to manage and ensure only one version is installed.
      # For conda
      conda list | grep cuda
      conda list | grep cudnn
      
      # For pip
      pip list | grep torch
      pip list | grep tensorflow
      
    4. Update Libraries:

      • Ensure that all your libraries, especially transformers, torch, and tensorflow, are up to date. Sometimes, these issues are fixed in newer versions.
      pip install --upgrade transformers torch tensorflow
      
    5. Isolate Library Imports:

      • If you are using multiple libraries that rely on CUDA, try to isolate their imports. For example, if you are using both PyTorch and TensorFlow, use them in separate cells or scripts if possible.

    Here is an example of a cleaned-up version of your script with warning suppression:

    import os
    import warnings
    from transformers import AutoProcessor, AutoModelForCausalLM
    from PIL import Image
    import requests
    import copy
    %matplotlib inline
    
    # Suppress TensorFlow warnings
    os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'  
    
    # Suppress general Python warnings
    warnings.filterwarnings("ignore", category=UserWarning)
    
    # Your code here
    processor = AutoProcessor.from_pretrained("model_name")
    model = AutoModelForCausalLM.from_pretrained("model_name")
    
    # Example usage
    image = Image.open(requests.get("https://example.com/image.jpg", stream=True).raw)
    inputs = processor(images=image, return_tensors="pt")
    outputs = model.generate(**inputs)
    print(processor.decode(outputs[0], skip_special_tokens=True))
    

    Conclusion

    These warnings are typically benign but can be suppressed for cleaner output. Ensuring a clean environment and avoiding multiple CUDA initialisations can help prevent these messages from appearing.

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.