Answer the question
In order to leave comments, you need to log in
How to fix AttributeError: module 'tensorflow' has no attribute 'name_scope'?
I'm trying to run a program that literally 10 minutes ago worked without problems, but now it gives an error about the absence of the 'name_scope' attribute. During this time I did not install any new modules, did not change anything in them.
import csv
import numpy as np
import tensorflow as tf
from keras.models import Sequential
from keras.layers import Dense, Flatten, Activation
from keras.layers import Dropout
from keras.layers.convolutional import Convolution2D, MaxPooling2D
from tensorflow.keras import utils
train_imgs=[]
a=[]
b=[]
with open('train.csv', 'r') as csv_file:
csv_reader=csv.reader(csv_file)
next(csv_reader)
for line in csv_reader:
for i in line[0]:
i=int(i)
a.append(i)
train_labels=utils.to_categorical(a, 10)
class_names = ["Злость", "Отвращение", "Страх", "Радость", "Грусть", "Удивление", "Нейтральная эмоция" ]
AttributeError: module 'tensorflow' has no attribute 'name_scope'
Answer the question
In order to leave comments, you need to log in
In any incomprehensible situation - reinstall:
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question