דילוג לתוכן
  • דף הבית
  • קטגוריות
  • פוסטים אחרונים
  • משתמשים
  • חיפוש
  • חוקי הפורום
כיווץ
תחומים

תחומים - פורום חרדי מקצועי

💡 רוצה לזכור קריאת שמע בזמן? לחץ כאן!
  1. דף הבית
  2. תכנות
  3. התקנת חבילת tensorflow==1.13.1 בפיתון בגרסאת 3.11.3

התקנת חבילת tensorflow==1.13.1 בפיתון בגרסאת 3.11.3

מתוזמן נעוץ נעול הועבר תכנות
4 פוסטים 2 כותבים 193 צפיות
  • מהישן לחדש
  • מהחדש לישן
  • הכי הרבה הצבעות
התחברו כדי לפרסם תגובה
נושא זה נמחק. רק משתמשים עם הרשאות מתאימות יוכלו לצפות בו.
  • M מנותק
    M מנותק
    miri chanucka
    כתב ב נערך לאחרונה על ידי dovid
    #1

    משהו יודע איך מתקינים את הגרסה המסוימת הזאת של tensorflow==1.13.1 על פיתון 3.11.3 הוא עושה לי שגיאה עליו ולכן הרצתי אותו בלי גרסה מסוימת - הגרסה האחרונה וכשאני מריצה את הפרויקט הוא נותן לי את השגיאה הבאה שאורת שיש בעיה בהתאמת הגרסאות:

    :\Users\1\.vscode\extensions\ms-python.python-2023.8.0\pythonFiles\lib\python\debugpy\adapter/../..\debugpy\launcher' '49735' '--' 'd:\Miri studies\The big project\smart-TraficLight\smartTraficLights\Adaptive-Traffic-Lights\setup.py' 
    C:\Users\1\AppData\Local\Programs\Python\Python311\Lib\site-packages\setuptools\_distutils\dist.py:265: UserWarning: Unknown distribution option: 'inplace'
      warnings.warn(msg)
    C:\Users\1\AppData\Local\Programs\Python\Python311\Lib\site-packages\setuptools\dist.py:520: SetuptoolsDeprecationWarning: Invalid version: <module 'version' from 'D:\\Miri studies\\The big project\\smart-TraficLight\\smartTraficLights\\Adaptive-Traffic-Lights\\darkflow\\version.py'>.
    !!
    
            ********************************************************************************
            The version specified is not a valid version according to PEP 440.
            This may not work as expected with newer versions of
            setuptools, pip, and PyPI.
    
            By 2023-Sep-26, you need to update your project and remove deprecated calls
            or your builds will no longer be supported.
    
            See https://peps.python.org/pep-0440/ for details.
            ********************************************************************************
    
    !!
      self._validate_version(self.metadata.version)
    usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
       or: setup.py --help [cmd1 cmd2 ...]
       or: setup.py --help-commands
       or: setup.py cmd --help
    
    error: no commands supplied
    
    תגובה 1 תגובה אחרונה
    0
    • ElhananE מנותק
      ElhananE מנותק
      Elhanan
      כתב ב נערך לאחרונה על ידי Elhanan
      #2

      @miri-chanucka

      השגיאה מציינת שהקובץ setup.py שנמצא בנתיב X, כולל ״אופצייה״ לא מוכרת בשם inplace.
      כמו״כ השגיאה כותבת שהגרסא (לכאורה של darkflow) שמצויינת בקובץ setup.py אינה תקפה ולא תעבוד כצפוי אם גרסאות חדשות יותר.

      ע״מ שאוכל לעזור ולהבין יותר, נשמח אם תצרפי את הקובץ setup.py כדי שנוכל לאתר את השגיאות בו.

      לעצם שאלתך, התקנת גרסא ספציפית של ספרייה מpip מתבצע באמצעות הוספת == עם מספר הגרסא לאחר פקודת ההתקנה. לדוגמא למקרה שלך (אוחזים כיום בגרסא 2.12.0, 1.13.1 ממש ישנה):

      pip install tensorflow==1.13.1
      

      האמת שלא ממש הבנתי את השאלה, אז מקווה שהתשובה תעזור לך.. לחילופין צרפי את הקובץ setup.py

      פורום איש את רעהו|חיתוך שירים|בלוג|מקצר קישורים|ביו

      תגובה 1 תגובה אחרונה
      3
      • M מנותק
        M מנותק
        miri chanucka
        כתב ב נערך לאחרונה על ידי dovid
        #3

        זה הקובץ שלי:

        from setuptools import setup, find_packages
        from setuptools.extension import Extension
        from Cython.Build import cythonize
        import numpy
        import os
        
        
        import importlib.util  
        
        def load_module(name, path):
            spec = importlib.util.spec_from_file_location(name, path)
            module = importlib.util.module_from_spec(spec)
            spec.loader.exec_module(module)
            return module
        
        VERSION = load_module('version',os.path.join('darkflow', 'version.py'))
        
        
        if os.name =='nt' :
            ext_modules=[
                Extension("darkflow.cython_utils.nms",
                    sources=["darkflow/cython_utils/nms.pyx"],
                    #libraries=["m"] # Unix-like specific
                    include_dirs=[numpy.get_include()]
                ),        
                Extension("darkflow.cython_utils.cy_yolo2_findboxes",
                    sources=["darkflow/cython_utils/cy_yolo2_findboxes.pyx"],
                    #libraries=["m"] # Unix-like specific
                    include_dirs=[numpy.get_include()]
                ),
                Extension("darkflow.cython_utils.cy_yolo_findboxes",
                    sources=["darkflow/cython_utils/cy_yolo_findboxes.pyx"],
                    #libraries=["m"] # Unix-like specific
                    include_dirs=[numpy.get_include()]
                )
            ]
        
        elif os.name =='posix' :
            ext_modules=[
                Extension("darkflow.cython_utils.nms",
                    sources=["darkflow/cython_utils/nms.pyx"],
                    libraries=["m"], # Unix-like specific
                    include_dirs=[numpy.get_include()]
                ),        
                Extension("darkflow.cython_utils.cy_yolo2_findboxes",
                    sources=["darkflow/cython_utils/cy_yolo2_findboxes.pyx"],
                    libraries=["m"], # Unix-like specific
                    include_dirs=[numpy.get_include()]
                ),
                Extension("darkflow.cython_utils.cy_yolo_findboxes",
                    sources=["darkflow/cython_utils/cy_yolo_findboxes.pyx"],
                    libraries=["m"], # Unix-like specific
                    include_dirs=[numpy.get_include()]
                )
            ]
        
        else :
            ext_modules=[
                Extension("darkflow.cython_utils.nms",
                    sources=["darkflow/cython_utils/nms.pyx"],
                    libraries=["m"] # Unix-like specific
                ),        
                Extension("darkflow.cython_utils.cy_yolo2_findboxes",
                    sources=["darkflow/cython_utils/cy_yolo2_findboxes.pyx"],
                    libraries=["m"] # Unix-like specific
                ),
                Extension("darkflow.cython_utils.cy_yolo_findboxes",
                    sources=["darkflow/cython_utils/cy_yolo_findboxes.pyx"],
                    libraries=["m"] # Unix-like specific
                )
            ]
        
        setup(
            version=VERSION,
        	name='darkflow',
            description='Darkflow',
            license='GPLv3',
            url='https://github.com/thtrieu/darkflow',
            packages = find_packages(),
        	scripts = ['flow'],
            ext_modules = cythonize(ext_modules)
        )
        והוא לא נותן לי להתקין אותו כך:pip install tensorflow==1.13.1  וזאת השגיאה שהוא נותן:
        ERROR: Could not find a version that satisfies the requirement tensorflow==1.13.1 (from versions: 2.12.0rc0, 2.12.0rc1, 2.12.0, 2.13.0rc0)           
        ERROR: No matching distribution found for tensorflow==1.13.1         
        ההיתי צריכה להריץ קובץ requirements.txt והוא נתקע לי שם האמצע והוא כותב את השגיאה:
        ERROR: Could not find a version that satisfies the requirement astor==0.8.1astor==0.8.1 (from versions: 0.1, 0.2, 0.2.1, 0.3, 0.4, 0.4.1, 0.5, 0.6, 0.6.1, 0.6.2, 0.7.0, 0.7.1, 0.8.0, 0.8.1)
                  
                  ERROR: No matching distribution found for astor==0.8.1astor==0.8.1         
        
        זה הקובץrequirements.txt:
        absl-py==0.11.0
        astor==0.8.1astor==0.8.1
        cached-property==1.5.2
        cycler==0.10.0
        Cython==0.29.21
        gast==0.4.0
        grpcio==1.35.0
        h5py==3.1.0
        importlib-metadata==3.4.0
        Keras-Applications==1.0.8
        Keras-Preprocessing==1.1.2
        kiwisolver==1.3.1
        Markdown==3.3.3
        matplotlib==3.3.4
        mock==4.0.3
        opencv-python==4
        Pillow==8.1.0
        protobuf==3.14.0
        pyparsing==2.4.7
        python-dateutil==2.8.1
        pygame==2.0.1
        six==1.15.0
        tensorboard==1.13.1
        tensorflow==1.13.1
        tensorflow-estimator==1.13.0
        termcolor==1.1.0
        typing-extensions==3.7.4.3
        Werkzeug==1.0.1
        zipp==3.4.0
        

        אז פשוט התקנתי את הסיפריות אחת אחת בנפרד ומה שלא נתן עשיתי את הגרסה האחרונה
        ועכשיו בהרצה של $ python setup.py build_ext --inplace הוא כותב את השגיאה הבאה:

        SetuptoolsDeprecationWarning: Invalid version: <module 'version' from 'D:\\Miri studies\\The big project\\smart-TraficLight\\smartTraficLights\\Adaptive-Traffic-Lights\\darkflow\\version.py'>.
        !!
        
                ********************************************************************************
                The version specified is not a valid version according to PEP 440.
                This may not work as expected with newer versions of
                setuptools, pip, and PyPI.
        
                By 2023-Sep-26, you need to update your project and remove deprecated calls
                or your builds will no longer be supported.
        
                See https://peps.python.org/pep-0440/ for details.
                ********************************************************************************
        
        !!
          self._validate_version(self.metadata.version)
        running build_ext
        building 'darkflow.cython_utils.nms' extension
        "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -IC:\Users\1\AppData\Local\Programs\Python\Python311\Lib\site-packages\numpy\core\include -IC:\Users\1\AppData\Local\Programs\Python\Python311\include -IC:\Users\1\AppData\Local\Programs\Python\Python311\Include "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\ATLMFC\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\VS\include" /Tcdarkflow/cython_utils/nms.c /Fobuild\temp.win-amd64-cpython-311\Release\darkflow/cython_utils/nms.obj       
        nms.c
        C:\Users\1\AppData\Local\Programs\Python\Python311\include\pyconfig.h(59): fatal error C1083: Cannot open include file: 'io.h': No such file or directory
        error: command 'C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.35.32215\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
        
        וכשאני מריצה עם python3 כלומר כך:     python3 setup.py build_ext --inplace הוא כותב לי את השגיאה:
        
        :544: UserWarning: The version specified (<module 'version' from 'D:\\Miri studies\\The big project\\smart-TraficLight\\smartTraficLights\\Adaptive-Traffic-Lights\\darkflow\\version.py'>) is an invalid version, this may not work as expected with newer versions of setuptools, pip, and PyPI. Please see PEP 440 for 
        more details.
          warnings.warn(
        running build_ext
        building 'darkflow.cython_utils.nms' extension
        error: [WinError 2] The system cannot find the file specified
        

        אני אשמח מאש מאד אם תוכל לעזור לי !!!!!!!!!!!!!!
        תודה מראש על הכל!!!!!!!!!

        תגובה 1 תגובה אחרונה
        0
        • ElhananE מנותק
          ElhananE מנותק
          Elhanan
          כתב ב נערך לאחרונה על ידי Elhanan
          #4

          השגיאה באמת מציינת שיש בעייה עם הגרסא של ה-TensorFlow, ועם הקובץ requirements.txt.

          בקובץ requirements.txt יש כפילות של הספרייה astor, אפשר לפתור אותה על ידי מחיקת הכפילות (astor==0.8.1astor==0.8.1)

          בהרצה של python setup.py build_ext --inplace את מקבלת שגיאה שלא כל הספריות אכן נטענו כמו שצריך, הפיתרון הוא להתקין את הספריות והתלויות מחדש, (ולא להשתמש בVisual Studio 2022, לעבור ל Pycharm או VSC וכד)

          בנוגע ל-TensorFlow גרסא 1.13.1 שאת מקבלת שגיאה על ההתקנה שלו, פייתון 3.8 הפסיקה את התמיכה בגרסאות 1.* של TensorFlow, אם את צריכה את הגרסא הספציפית הזאת, נסי להשתמש בפייתון 3.6 או 3.7.

          זה בגדול התשובה לשגיאות המצויינות, שגיאות של התקנת ספריות, ואי תאימות של פייתון לTensorFlow. נסי לתקן את הבעיות ולבדוק אם הקוד עובד

          פורום איש את רעהו|חיתוך שירים|בלוג|מקצר קישורים|ביו

          תגובה 1 תגובה אחרונה
          2

          בא תתחבר לדף היומי!
          • התחברות

          • אין לך חשבון עדיין? הרשמה

          • התחברו או הירשמו כדי לחפש.
          • פוסט ראשון
            פוסט אחרון
          0
          • דף הבית
          • קטגוריות
          • פוסטים אחרונים
          • משתמשים
          • חיפוש
          • חוקי הפורום