Я работаю над своим проектом AI Chatbot, используя conda python 3.6.9. Я получаю следующие ошибки. Как исправить следующую ошибку?

Я делаю чат-бот AI, используя python.

Я установил все необходимые пакеты pip:

import nltk
from nltk.stem.lancaster import LancasterStemmer
stemmer = LancasterStemmer()

import numpy 
import tflearn
import tensorflow
import random
import json


with open("intents.json") as file:
    data = json.load(file)

print(data)

Ожидал :

(VCB) C: \ Users \ Aravind Nallajerla \ Desktop \ Capstone Project \ VCB> python main.py

{
    'intents': [{
        'tag': 'greeting',
        'patterns': ['Hi', 'How are you', 'Is anyone there?', 'Hello', 'Good day', 'Whats up'],
        'responses': ['Hello!', 'Good to see you again!', 'Hi there, how can I help?'],
        'context_set': ''
    }, {
        'tag': 'goodbye',
        'patterns': ['cya', 'See you later', 'Goodbye', 'I am Leaving', 'Have a Good day'],
        'responses': ['Sad to see you go :(', 'Talk to you later', 'Goodbye!'],
        'context_set': ''
    }, {
        'tag': 'age',
        'patterns': ['how old', 'how old is tim', 'what is your age', 'how old are you', 'age?'],
        'responses': ['I am 18 years old!', '18 years young!'],
        'context_set': ''
    }, {
        'tag': 'name',
        'patterns': ['what is your name', 'what should I call you', 'whats your name?'],
        'responses': ['You can call me Tim.', "I'm Tim!", "I'm Tim aka Tech With Tim."],
        'context_set': ''
    }, {
        'tag': 'shop',
        'patterns': ['Id like to buy something', 'whats on the menu', 'what do you reccommend?', 'could i get something to eat'],
        'responses': ['We sell chocolate chip cookies for $2!', 'Cookies are on the menu!'],
        'context_set': ''
    }, {
        'tag': 'hours',
        'patterns': ['when are you guys open', 'what are your hours', 'hours of operation'],
        'responses': ['We are open 7am-4pm Monday-Friday!'],
        'context_set': ''
    }]
} 

Действительный :

Traceback (последний вызов последним): файл "main.py", строка 6, в файле import tflearn "C: \ Users \ Aravind Nallajerla \ AppData \ Local \ conda \ conda \ envs \ VCB \ lib \ site-packages \ tflearn__init__ .py ", строка 4, в с. файл конфигурации импорта "C: \ Users \ Aravind Nallajerla \ AppData \ Local \ conda \ conda \ envs \ VCB \ lib \ site-packages \ tflearn \ config.py", строка 5, из файла переменной импорта .variables "C: \ Users \ Aravind Nallajerla \ AppData \ Local \ conda \ conda \ envs \ VCB \ lib \ site-packages \ tflearn \ variables.py ", строка 7, in from tensorflow.contrib.framework.python.ops import add_arg_scope как contrib_add_arg_scope ModuleNotFoundError : Нет модуля с именем 'tensorflow.contrib


person Aravind Nallajerla    schedule 31.10.2019    source источник
comment
что такое версия тензорного потока ... это можно найти с помощью print(tensorflow.__version__)   -  person Anwarvic    schedule 31.10.2019
comment
проверьте это: stackoverflow.com/questions/55082483/   -  person PV8    schedule 31.10.2019
comment
и этот: github.com/tensorflow/tensorflow/issues/31350   -  person PV8    schedule 31.10.2019


Ответы (1)


удалите последний тензорный поток, у него нет модуля -contrib.

pip uninstall tensorflow

затем попробуйте эту старую версию.

pip install tensorflow==1.13.2
person ARUN LEE    schedule 02.01.2020