acoustic-van-30942
02/15/2023, 4:36 PMpython gw_train.py show , it returns the following error:
ImportError: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.26' not found (required by /home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages/scipy/linalg/_matfuncs_sqrtm_triu.cpython-310-x86_64-linux-gnu.so)
Any insight as to what is causing this error? As a workaround, I suppose I could just create my own custom dockerfile, then bake this custom package into it, and then pass the ecr docker image into @batch. But would be nice to just import this directly and have Metaflow automatically create a code package including my custom libraries.acoustic-van-30942
02/15/2023, 4:40 PMfrom metaflow import FlowSpec, step, batch, conda
from my_model.train_and_evaluate import runStandalone
class GWFlow(FlowSpec):
@step
def start(self):
"""
This is the start of the flow
"""
self.next(self.load_data)
@conda(libraries={'bidict': '0.22.1',
'torch': '1.11.0',
'torch-geometric': '2.1.0',
'torch-scatter': '2.1.0',
'torch-sparse': '0.6.16',
'torchvision': '0.12.0',
'pandas-profiling': '3.6.6',
'graphviz': '0.20.1'
},
python='3.8.1'
)
@batch(cpu=8, memory=10000)
@step
def train(self):
"""
Train embedder model
"""
print('Train embedder model ...')
runStandalone(...)
self.next(self.end)
@step
def end(self):
"""
This is the end of the flow
"""
if __name__ == "__main__":
GWFlow()crooked-jordan-29960
02/15/2023, 4:47 PMacoustic-van-30942
02/15/2023, 4:51 PMclass.crooked-jordan-29960
02/15/2023, 4:56 PMmy_model library in a python file that runs a flow?crooked-jordan-29960
02/15/2023, 5:03 PMexport LD_LIBRARY_PATH=<PATH TO CONDA /lib DIRECTORY>acoustic-van-30942
02/15/2023, 5:04 PMmy_model import, no error.crooked-jordan-29960
02/15/2023, 5:07 PMfrom my_model.train_and_evaluate import runStandalone in other Python files?acoustic-van-30942
02/15/2023, 5:08 PMacoustic-van-30942
02/15/2023, 5:09 PMcrooked-jordan-29960
02/15/2023, 5:10 PMmy_model setup script to do 🤔 will do some searching in ten minutes or soacoustic-van-30942
02/15/2023, 5:31 PM%%bash
export LD_LIBRARY_PATH="/home/ec2-user/anaconda3/lib"
python my_train.pycrooked-jordan-29960
02/15/2023, 5:31 PMacoustic-van-30942
02/15/2023, 5:31 PMacoustic-van-30942
02/15/2023, 5:41 PMacoustic-van-30942
02/15/2023, 5:48 PMBootstrapping conda environment...(this could take a few minutes)
Conda ran into an error while setting up environment.:
Step: start, Error: command '['/home/ec2-user/anaconda3/condabin/conda', 'create', '--yes', '--no-default-packages', '--name', 'metaflow_GWFlow_linux-64_7b6d74c7d55dd5d2b9a4874a8334691e4d156140', '--quiet', b'python==3.10.6', b'requests==>=2.21.0', b'boto3==>=1.14.0']'
I did specify those in my libraries though...
@conda(libraries={'bidict': '0.22.1',
'torch': '1.11.0',
'torch-geometric': '2.1.0',
'torch-scatter': '2.1.0',
'torch-sparse': '0.6.16',
'torchvision': '0.12.0',
'pandas-profiling': '3.6.6',
'graphviz': '0.20.1',
'boto3': '1.14.0',
'requests': '2.21.0'
},
python='3.10.6'
)crooked-jordan-29960
02/15/2023, 5:53 PMstart step, and in the flow pasted above the @conda is only being applied to the train step. A quick option that I tend to do on flows with only a few steps like this is to change this decorator to @conda_base and move to flow-level
@conda_base(libraries={'bidict': '0.22.1',
'torch': '1.11.0',
'torch-geometric': '2.1.0',
'torch-scatter': '2.1.0',
'torch-sparse': '0.6.16',
'torchvision': '0.12.0',
'pandas-profiling': '3.6.6',
'graphviz': '0.20.1',
'boto3': '1.14.0',
'requests': '2.21.0'
},
python='3.10.6'
)
class GWFlow(FlowSpec):acoustic-van-30942
02/15/2023, 5:54 PMtrain stepacoustic-van-30942
02/15/2023, 5:56 PMcrooked-jordan-29960
02/15/2023, 5:56 PM