anyone helping me resolve this issue?
I am trying to get my code running on virutal env. on Pycharm, but continue to run into ModuleNotFoundError: No module named ‘tensorflow.compat’.
the snippet is below.
import numpy as np
import tensorflow as tf
from keras.models import Sequential
from sklearn.model_selection import train_test_split
class _lstm_model:
def init(self):
self._x = None
self._y = None
def Run_Model(self):
n_feature = 1
X_train, X_test, Y_train, Y_test = train_test_split(self._x, self._y, test_size=0.3, random_state=10)
model = Sequential()
and this is callstack I got
-------------------------------------------------------------------------------.
Traceback (most recent call last):
File “C:\Users\c_kyu\Development\PersonalProject\ML\stockmarket\Runner\Runner.py”, line 5, in
from Models.lstm_model import lstm_model
File “C:\Users\c_kyu\Development\PersonalProject\ML\stockmarket\Models_lstm_model.py”, line 5, in
from keras.models import Sequential
File "C:\Users\c_kyu\AppData\Local\Programs\Python\Python311\Lib\site-packages\keras_init.py", line 21, in
from keras import models
File "C:\Users\c_kyu\AppData\Local\Programs\Python\Python311\Lib\site-packages\keras\models_init.py", line 18, in
from keras.engine.functional import Functional
File “C:\Users\c_kyu\AppData\Local\Programs\Python\Python311\Lib\site-packages\keras\engine\functional.py”, line 24, in
import tensorflow.compat.v2 as tf
ModuleNotFoundError: No module named ‘tensorflow.compat’
I am googling for a bit to find the solution, but was failing with all solutions being said online I found.